CSS3伪元素::first-line、::first-letter、 ::Selection
2014-06-11 15:16
337 查看
css部分:
p::first-line {font-weight:bold;}/*::first-line选择元素的第一行*/p::first-letter {font-size: 56px; float:left; margin-right:10px;}/*::first-letter选择文本块的第一个字符,段落排版,首字下沉*/p::selection{ background:red; color:#fff;}/*::selection用来改变浏览网页选中文的默认效html部分:
<p style="width:800px; padding:10px 0;">:selection改变在浏览器中选中文本后的背景色与前景色,在IE家族中,只有IE9+版本支持,在Firefox中需要加上其前缀“-moz”,查阅相关w3c官方资料,并没有对这个属性的解说资料,只知道这个属性被规纳在CSS的伪类选择器中。::selection”只能设置两个属性,一个就是background,另一个就是color属性,设置其他属性是没有任何效果的.</p>预览效果截图:
相关文章推荐
- HTML5基础加强css样式篇(伪元素first-letter,first-line,selection和css计数函数counter,counters)(十六)
- css3基础 ::first-letter/line 设置首个汉字/首行的样式
- 伪类的其他标签:first-letter,first-line、::selection、nth-child
- 伪元素first-letter
- [转]:first-letter和:first-line伪类
- CSS基础 当p first-letter与first-line冲突时
- css 伪元素(before,after,first-letter,first-line)
- 在IE6里无法识别first-letter/:first-line?
- IE6无法识别伪对象:first-letter和:first-line解决方法
- css伪元素选择器,first-letter、first-line
- CSS高级-伪元素first-letter,first-line,before和after
- CSS的单位及css3的calc()及line-height百分比
- css3:selection
- CSS-first-letter实现首字下沉
- Compare to files,printing the first line where they differ
- a missing vtable usually means the first non-inline virtual member function 问题
- CSS基础 p first-letter设置所有,段落第一个字的背景颜色
- first-letter解决了序号缩进问题
- CSS的单位及css3的calc()及line-height百分比
- CSS3:nth-child()伪类选择器,奇偶数行自定义样式first-child