new style attrubutes needed to seperate css from html

View: New views
3 Messages — Rating Filter:   Alert me  

new style attrubutes needed to seperate css from html

by Digital Effects - NZ :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
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.
 
Regards,
James Luckhurst


n.gif (120 bytes) Download Attachment

Re: new style attrubutes needed to seperate css from html

by Jens Meiert-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> 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...

Doesn’t CSS’s Template Layout Module [1] help with what you suggest?

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

Whose code?

Every author gets the separation he’s aiming for.


[1] http://www.w3.org/TR/css3-layout/

--
Jens Meiert
http://meiert.com/en/


Re: new style attrubutes needed to seperate css from html

by Giovanni Campagna :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Remember that you can always use XSLT to reorder a document from a
source in natural order to a formatting version in presentation order.

In addition, the CSSWG is working on a feature that allows reparenting
of content (Named Floats or Named Flows), you find it at
http://www.w3.org/TR/css3-content and
http://www.w3.org/TR/css3-gcpm

Giovanni