jquery toggle 没有切换以及为什么我的背景重复

标签 jquery html css

我是新手,我做了 this页,但我有 2 个问题。我不想重复我的背景,我的 Jquery 切换不起作用:(

这是我的代码的一部分。我需要更改什么才能使其正常工作?

body {
    background: url("http://dash.ga.co/assets/anna-bg.png");
    background-size: cover;
    background-position: center;
}
.first {
    background: #000;
    background-image: url("http://buddies.koinup.com/group-637.png");
    background-size: cover;
    background-position: center;
    width: 200px;
    height: 200px;
    position: fixed;
    top: 50%;
    left: 50%;
    margin-top: -100px;
    margin-left: -100px;
    border: 1px solid #000;
    border-radius: 10px;

}
p {
    color: rgba(255,255,255,1);
    background: black;
    background: linear-gradient(bottom, rgba(0,0,0,1), rgba(0,0,0,.4));
    background: -webkit-linear-gradient(bottom, rgba(0,0,0,1), rgba(0,0,0,.4));
    background: -moz-linear-gradient(bottom, rgba(0,0,0,1), rgba(0,0,0,.4));
    padding: 10px;
    line-height: 28px;
    text-align: justify;
    position: absolute;
    bottom: 0;
    margin: 0;
    padding: 3px 65px 3px 64px;
    height: 30px;
    border-radius: 0px 0px 8px 8px;
    transition: height .5s;
    -webkit-transition: height .5s;
    -moz-transition: height .5s;
}

最佳答案

背景:

body {
    background-repeat: no-repeat;
}

对于 jQuery:您没有导入库。代码本身有效。更新的 JSFiddle:http://jsfiddle.net/qun3fbz2/1/

关于jquery toggle 没有切换以及为什么我的背景重复,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25641412/

相关文章:

html - 如何使图像居中

html - CSS:在没有绝对位置的网页上制作 "overflowable"段

javascript - 通过外部回调访问此内容

jquery限制元素查询结果

html - 最大宽度似乎在 safari 中不起作用

html - 如何在 iframe 中查看 Google drive pdf 链接

javascript - 如何不替换已经被替换的单词

javascript - 带有条件字段的 PHP 表单

CSS 选择器 - 特异性问题

html - border-radius 后面的背景颜色