The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Design Styling numbers wrapped in H tag Reply To: Styling numbers wrapped in H tag


Seems like a perfect use case for a pseudo with counter-increment:


Although reading back your additional description is indeed slightly confusing…

Edit – in retrospect I think I may have misunderstood altogether. Is your question maybe if HTML/CSS can recognise the content of a h element? In that case the answer would be negative. Then again, simplest way would be to give them a common class and style that.

But maybe you could elaborate a bit more on the expected result.

My suggestion above would be a nice alternative for the example page though.

Second edit – this might be an approach too: