[thelist] Coding standards.... [headers]

Lee kowalkowski lee.kowalkowski at googlemail.com
Mon Dec 11 08:54:27 CST 2006


To understand the semantic angle.  Let's suppose there was a CSS
property you could apply to your heading elements that automatically
numbered your headings using the notation 1.1.1... etc.

A level 1 heading, would start a new section.  On the web, you could
say a new section should start a new page, just like when authoring
non-web documents.  Therefore, you would put something in your coding
standards to this effect.  Your numbering solution would also need to
be able to start numbering from any arbitrary number in this case.

Level 2 headings would be direct subsections of the level 1 section,
and have numbers like 1.1, 1.2, 2.1, 8.5, and so on for the rest of
the levels.  I think most people are familiar with this system of
numbered headings.

HTML heading elements aren't automatically numbered, but it is not
uncommon for people to apply a similar semantic view.  Which means it
doesn't make sense to have a level 3 heading without a level 2 (or a
level 1).  That is, it doesn't make sense to have a section 1.3.2 if
there's no section 1.3 or no section 1.

But this is just a traditional semantic view.  It may be feasible in
another design for the different heading levels to have an alternative
semantic meaning, e.g., level 1 = Emergency Notices, level 2 = Warning
Notices, level 3 = Information Notices.

Both systems can be implemented with valid HTML, although you do get a
telling-off if you've skipped headings and have checked "show outline"
in the W3C validator.  It's just a matter of ensuring the coding
standards support/enforce the semantic view of the chosen design.



More information about the thelist mailing list