CSS content property in Firefox
Posted by David Zaslavsky onHere’s something I discovered today: the CSS content
property can’t be applied to arbitrary elements in Firefox.
Actually, what I probably should have been surprised to discover is that it can be applied to arbitrary elements in Konqueror. This is pretty useful in my case, namely for creating the “blog” text that appears with the blue/black background at the top-left corner of each post, but it doesn’t make a whole lot of sense in general. Normally the content of an HTML element is determined from the HTML page itself, and if the browser allows the content to also be set by the CSS, how do you resolve the conflict? If you use the content from the CSS, then you’re ignoring a chunk of the HTML source document, which doesn’t make sense, and if you use the content from the HTML, then you’re ignoring the CSS property, which means it might as well not be there. (As you might have guessed, Konqueror takes the former approach and Firefox takes the latter)
The obvious question now is, what’s the proper behavior? I checked out the CSS 2.1 standard and in section 12.2 …