"Correct" use of CSS
Posted: Mon Sep 23, 2002 9:08 am
Having finally gotten free of legacy browsers (10% down to 0.01% and that one appears to be a search engine) I'm trying to do things the right way. However I haven't found many good tutorials on this yet.
There are loads of tutorials showing how to make such-and-such a layout with CSS, and many addressing how to use it in ways that will be bug-compatible on many browsers. What I'm interested in is more of the "theoretical/ideal" world -- assume that the browser is completely CSS1 compliant. I plan to have two or more versions of the site: one is the current legacy version the other the fully compliant XHTML 1.0 Strict/CSS1 version.
With that as the framework, can anyone help with these questions?
1). Are there good tutorials on "proper" structure/layout seperation that go beyond the simple "here's a three column layout" -- heuristics to determine when to use div's or when to use class/id tag on existing elements?
2). In this "ideal" world, the only correct use of tables is for tabular text/numbers as in scientific results and similar, correct? Using tables to align form elements would be incorrect, yes? Is there a correct way to align form elements -- using a pair of divs seems wrong as that ends up grouping all the labels seperate from the elements which would be exteremly bad for non-visual users.
3). Following from the above, divs are vertical grouping structures that tend to apply horizontal extents to their members. spans are kinda the flip, horizontal groupings that apply vertical extents, amoung other things. Tables are 2-D structures that apply 2-D constraints. Are there elements to provide horizontal grouping, but horizontal layout within that don't have the negative view as tables?
Eric
There are loads of tutorials showing how to make such-and-such a layout with CSS, and many addressing how to use it in ways that will be bug-compatible on many browsers. What I'm interested in is more of the "theoretical/ideal" world -- assume that the browser is completely CSS1 compliant. I plan to have two or more versions of the site: one is the current legacy version the other the fully compliant XHTML 1.0 Strict/CSS1 version.
With that as the framework, can anyone help with these questions?
1). Are there good tutorials on "proper" structure/layout seperation that go beyond the simple "here's a three column layout" -- heuristics to determine when to use div's or when to use class/id tag on existing elements?
2). In this "ideal" world, the only correct use of tables is for tabular text/numbers as in scientific results and similar, correct? Using tables to align form elements would be incorrect, yes? Is there a correct way to align form elements -- using a pair of divs seems wrong as that ends up grouping all the labels seperate from the elements which would be exteremly bad for non-visual users.
3). Following from the above, divs are vertical grouping structures that tend to apply horizontal extents to their members. spans are kinda the flip, horizontal groupings that apply vertical extents, amoung other things. Tables are 2-D structures that apply 2-D constraints. Are there elements to provide horizontal grouping, but horizontal layout within that don't have the negative view as tables?
Eric