已采纳回答 / 无聊到死君
多行用 js控制字符串长度 ,并且替换多出来的字符
已采纳回答 / purple_yao
亲,是的,是它的图片有问题,已经做了修正,这个小节的例子是想举一个从左到右的渐变,而且可以加入多个颜色,但是最后的效果图片给错了。。。我们已经做了修正。谢谢,给我们的建议,再次感谢。
2015-01-15
“:first-of-type”定位一个父元素下的某个类型的第一个子元素。
.wrapper > p:first-of-type {background: orange;}
.wrapper > p:first-of-type {background: orange;}
2015-01-14
“:nth-last-child(n)”从某父元素的最后一个子元素开始计算,来选择特定的元素。
ol > li:nth-last-child(5){background: orange;}
ol > li:nth-last-child(5){background: orange;}
2015-01-14
“:nth-child(n)”选择器用来定位某个父元素的一个或多个特定的子元素。
ol > li:nth-child(2n){background: orange;}
ol > li:nth-child(2n){background: orange;}
2015-01-14
“:last-child”选择器选择元素的最后一个子元素。
ul>li:last-child{background:blue;}
ul>li:last-child{background:blue;}
2015-01-14
“:first-child”选择器表示的是选择父元素的第一个子元素的元素E。
ol > li:first-child{color: red;}
ol > li:first-child{color: red;}
2015-01-14
:target选择器称为目标选择器,用来匹配文档(页面)的URI的某个标志符的目标元素。
html:
<h2><a href="#aron">Brand</a></h2>
<div class="menuSection" id="aron">content for aron</div>
css:
#aron:target {background: red;color: #fff;}
html:
<h2><a href="#aron">Brand</a></h2>
<div class="menuSection" id="aron">content for aron</div>
css:
#aron:target {background: red;color: #fff;}
2015-01-14
:empty选择器表示的就是空。用来选择没有任何内容的元素,这里没有内容指的是一点内容都没有,哪怕是一个空格。
p:empty {
border: 1px solid green;}
p:empty {
border: 1px solid green;}
2015-01-14
:not选择器称为否定选择器,选择除某个元素之外的所有元素。
input:not([type="submit"]){
border:1px solid red;}
input:not([type="submit"]){
border:1px solid red;}
2015-01-14
“:root”选择器等同于<html>元素,简单点说:
:root{background:orange}
html {background:orange;}
得到的效果等同。
:root{background:orange}
html {background:orange;}
得到的效果等同。
2015-01-14