CSS pseudo-element in inline attribute style

后端 未结 2 1674
没有蜡笔的小新
没有蜡笔的小新 2020-12-22 04:36

I have tried with the sample below from the url. What I trying is to apply css pseudo-element in inline attribute, style. Somehow, it seems not working. I would appreciate f

相关标签:
2条回答
  • 2020-12-22 05:12

    It’s not possible. The working draft you are referring to is over 12 years old. Click on the link “Latest version” in it, and you’ll find the CSS Style Attributes, a W3C Recommendation (“W3C standard”). It was approved recently. It contains no changes to the style attribute as in HTML specs, and this is indeed the message: the attribute has not been enhanced, and there are no plans to do so.

    The conclusions depend on why you would use the construct. Normally, just assign an id attribute to the element and use an id selector in CSS.

    0 讨论(0)
  • 2020-12-22 05:30

    Try to do it this way

    <p style="color: green; width: 10em"><span style="float: left; font-size: 300%">L</span>orem Ipsum</p>
    
    0 讨论(0)
提交回复
热议问题