我是新手,我做了 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/