.wrapper > div:nth-of-type(odd),
.wrapper > p:nth-of-type(2n){
background: orange;
}
/*或者*/
.wrapper > div:nth-of-type(2n+1),
.wrapper > p:nth-of-type(2n){
background: orange;
}
/*或者*/
.wrapper > div:nth-of-type(2n-1),
.wrapper > p:nth-of-type(even){
background: orange;
}
.wrapper > p:nth-of-type(2n){
background: orange;
}
/*或者*/
.wrapper > div:nth-of-type(2n+1),
.wrapper > p:nth-of-type(2n){
background: orange;
}
/*或者*/
.wrapper > div:nth-of-type(2n-1),
.wrapper > p:nth-of-type(even){
background: orange;
}
2015-01-24
1,触发事件名为:#+触发选择器ID;
2,目标事件:触发事件名+:target{};如上题:#brand:target{};
2,目标事件:触发事件名+:target{};如上题:#brand:target{};
2015-01-24
a[href*='##']{
background-color:red;
}
a[href$=doc]{
background-color:green;
}
a[title*=box]{
background-color:blue;
}
background-color:red;
}
a[href$=doc]{
background-color:green;
}
a[title*=box]{
background-color:blue;
}
2015-01-24
/*伪元素制作分隔线*/
.nav li:after{content:"";position:absolute;top:20px;left:0px;height:10px;width:1px;
background-image:linear-gradient( rgba(100,100,100,0),rgba(25,25,25,1),rgba(100,100,100,0));}
/*删除第一项和最后一项分隔线*/
.nav li:first-child::after{background-image:none;}
咳咳,这里发现伪类和伪元素这一块要去学习下。
.nav li:after{content:"";position:absolute;top:20px;left:0px;height:10px;width:1px;
background-image:linear-gradient( rgba(100,100,100,0),rgba(25,25,25,1),rgba(100,100,100,0));}
/*删除第一项和最后一项分隔线*/
.nav li:first-child::after{background-image:none;}
咳咳,这里发现伪类和伪元素这一块要去学习下。
2015-01-24
background:url(http://static.mukewang.com/static/img/logo_index.png) no-repeat left top /220px 79px,
url(http://static.mukewang.com/static/img/logo_index.png) no-repeat right bottom /150px 55px;
我去,一体式写法。
url(http://static.mukewang.com/static/img/logo_index.png) no-repeat right bottom /150px 55px;
我去,一体式写法。
2015-01-24
background-origin:border-box;
background-clip:content-box;
background:#20b3db no-repeat;
background-clip:content-box;
background:#20b3db no-repeat;
2015-01-24
background setting repeat,it really dosen't work.
2015-01-24
已采纳回答 / 康振宁
这里是一个让文本垂直居中的小技巧:line-height与height设置一至。如本例中height:50px那么line-height:50px,也设置50px。
2015-01-24
X[xx^=xxx]{} 获取开头为xxx的xx属性的X元素;
X[xx$=xxx]{} 获取结尾为xxx的xx属性的X元素;
X[xx*=xxx]{} 获取任意位置为xxx的xx属性的X元素;
X[xx$=xxx]{} 获取结尾为xxx的xx属性的X元素;
X[xx*=xxx]{} 获取任意位置为xxx的xx属性的X元素;
2015-01-24