1.在CSS样式表里增添如下的代码
p:fisr-letter {float:left;font-size:50px;font-weight:bold;}
p:first-line {color:purple}
说明:增加空格,在伪对象选择符:first-letter/:first-line与包含规则的“{”间增加空格。
2.也可以在CSS样式表里添加如下的规则
p:first-letter
{float:left;font-size:50px;font-weight:bold;}
p:first-line
{color:purple}
说明:将整个花括号“{”规则区域换到下一行。
PS: :first-letter&:first-line的定义
1.”first-letter” 伪元素用于向文本的首字母设置特殊样式。它只能用于块级元素
下面的属性可应用于 “first-letter” 伪元素:
font
color
background
margin
padding
border
text-decoration
vertical-align (仅当 float 为 none 时)
text-transform
line-height
float
clear
2.”first-line” 伪元素用于向文本的首行设置特殊样式。它也只能用于块级元素。
下面的属性可应用于 “first-line” 伪元素:
font
color
background
word-spacing
letter-spacing
text-decoration
vertical-align
text-transform
line-height
clear
以上就是IE6无法识别伪对象:first-letter和:first-line如何解决方法。坚持每天提高1%,70天工作水平就可以提升一倍。更多关于IE6无法识别伪对象:first-letter和:first-line如何解决方法请关注haodaima.com其它相关文章!