Today, I learned something new about CSS: You cannot use :before inline. Come to think of it, that should have been clear. After all, inline styles are valid for exactly one element -- namely the element with the style option. But since :before is a pseudo-element, it does not have an HTML tag, so you cannot define an inline style for it.

I had tried something like this:

<div style=":before {content: url(xyz.png)}" >Text</div>

This is, of course, rubbish. Inline-styles lack elements as well as curly braces. I have solved the problem at hand slightly differently, though, so at long last this blog has category icons.

12.11 am Kein Kommentardeutsch

von kirjoittaessani

Leave a Reply