【发布时间】:2013-12-06 22:55:23
【问题描述】:
我已尝试使用以下网址中的示例。我尝试的是在内联属性样式中应用 css 伪元素。不知何故,它似乎不起作用。如果您有任何建议,我将不胜感激。
http://www.w3.org/TR/2001/WD-css-style-attr-20010305
<p style="{color: green; width: 10em} ::first-letter {float: left; font-size: 300%}">
This is an example of a paragraph with inline style attribute rules to create a spot effect, in this case, a drop-cap first letter.
</p>
【问题讨论】:
-
您不能将属性应用于伪元素或内联伪类。您必须使用嵌入或链接的 CSS。
标签: html css pseudo-element inline-styles