Euan Ritchie's playground

Navigation

Search this site

Login More quotes… 
Expand all rantsList rants ordered backwards in timeList rants alphabetically

CSS ought be able to change markup

Markup and styling are inseparable in web technologies, so they ought interact appropriately

Among the problems creating web pages have fieldsets and their legends are a great example.

The HMTL spec says what a fieldset legend ought look like, but you can't render/specify it with CSS.

A fieldset legend is suppossed to lie across any fieldset border, and appear transparent with regard to background colours but not the border it lies across.

So browsers make up their own mind about how CSS ought effect fieldset legends and they all differ on it. The important part about the differences also involves how the legends are positioned.

To successfully render styled fiedsets and their legends similarly in all browsers fieldset contents have to be wrapped in a block (i.e div) to allow for moving the contents relative to the legend if it's moved itself.

The ONLY reason that div and many many others exist in web pages is to allow for the application of styles to acheive desired appearances and behaviours and their proliferation pollutes markup and actively undermines efforts to reconcile ymantic content and custom presentation.

Which makes me think CSS ought be able to insert 'markup' (nodes in the dom) before styling it so a truer spearation of content and style can be acheived.

Well, that sounds a lot like what XSLT was intended to be used for - if you stream well formed markup to a client it can apply a simple transformation that reorders/inserts markup on the client.

But that means a whole new technology (that's verbose and a little bit complex) for CSS stylers to learn barring the way to improved semantic content. I suggest it'd be easier for the world to adopt such advances by offering them as additional features of CSS rather than a whole new arcane technology.

Maybe the way to do it is with additional psuedo classes like, perhaps div.class:wrapper, div.class:sleave div.class:predecessor or div.class:successor to target 'virtual' initially unstyled elements.