new style attrubutes needed to seperate css from html

What I can't figure out why W3C never had the foresight to put in a parent attribute and an order attribute in the dom style structure.

If they did then your code would be totally separate from design (html from css) at the moment it isn't.

No matter what order you put your divs in the page the css constructors would re-order them without you having to physically move them in the html and using relatives not absolutes you could also change ownership of divs without wrapping them inside other divs so your code would look something like this...

basic example e.g.

[div id=4 style=order:4]line 4 important line[div]
[div id=2 style=order:2]line 2[div]
[div id=3 style=parent:2 order:1]line 3 inside div 2[div]
[div id=1 style=order:1]line 1[div]

and the result would be:

line 1
line 2
line 3 inside div 2
line 4 important line

instead of: (which is out of order)

line 4 important line
line 2
line 3 inside div 2 (which isn't inside the other div)
line 1

(okay you could say I can use floats yes you can but you can only reorder a max of 2 sibling divs... this is not good enough, floats should be used for alignment and not the order of how your divs are produced)

This way you could put the most important content at the top of your html source and less at the bottom for search engines without impacting on the design as you can move it via css without absolutes

You can move anything anywhere TOTAL FREEDOM

The only current work around is using absolutes, which is a crap way in controlling divs or floating which doesn't work in 3 or more div groups.

This also solves the problem of moving code chunks say I want to move my side menu to the top in a complex template, well the current way is to either move it in the HTML or use an absoulte position... this is bad the above way is to just readjust the parent order arrtibute in the stylesheet and BANG it's done.

James Luckhurst

Received on Thursday, 9 April 2009 09:34:57 UTC