Adam Adam - 4 months ago 46
CSS Question

css bold first word

How can I bold the first word of sentence using CSS selectors and is this a good/bad way to do this with respects to browser comparability?

code:

<h2>this is a sentence</h2>


thx

Answer

There is no ::first-word pseudo-element in CSS; you'll have to wrap the first word in an extra element and then select that.

Comments