@sammffl
2016-03-02T01:48:42.000000Z
字数 455
阅读 620
小技巧
1、attr(key)
<p data-unit="元">剩余话费40</p>
[data-unit]:after{
content: attr(data-unit);
color: #3b98e0;
}
2、currentColor
<div class="box"> 测试测试 </div>
.box{
width: 200px;
height: 200px;
color: #3b98e0;
border: 1px solid currentColor;
}
3、user-select
<div id="box-1">test</div>
#box-1{
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
4、::selection
<p id="sel">adfaksdfkalasdf</p>
#sel::selection{
background:#FE6E66;
color:#FFF;
}