For guys like me challenges like this verge in some respects towards irrelevance, because…
When you’re using CSS for your presentation layer, you don’t need that many elements in your markup
Solid knowledge of CSS obviates a lot of elements, leaving the producer with only a few that are essential:
- Document structure:
html
,head
,title
, andbody
- Document metadata:
link
andscript
- Headings:
h1
…h6
- Containers:
div
,span
, andp
- Lists:
ol
,ul
,dl
,li
,dt
, anddd
- Links:
a
- Emphasis and de-emphasis:
em
,strong
,big
, andsmall
- Forms:
form
,input
,select
,option
, andtextarea
To that producers working on diverse projects might add a few more:
- Images:
img
- Plug-in content:
object
andparam
- Quotes and sources:
blockquote
,q
, andcite
- Data tables:
table
,tr
,th
,td
, andcol
Once you open the book of document usability and cross-media accessibility, things start to telescope a bit:
- Parent element metadata:
legend
andcaption
- Form control helpers:
fieldset
,label
, andoptgroup
- Table containers:
thead
,tbody
, andtfoot
- Acronyms and abbreviations:
acronym
andabbr
…These three lists comprise 50 of the 91 elements officially supported in HTML 4, and the core of the namespace occupies only a third of the total.
What I omitted altogether, and why
base
andstyle
You only truly need these elements if the behavior of your publishing platform encourages or requires it.
applet
The inline-Java train left the station in 1998, boys and girls.
What I relegated to the secondary lists, and why
img
A picture may be worth a thousand words, but it’s been my experience that on most sites, images rarely comprise principal content. Getting full mileage out of the CSS background attributes is often more structurally/semantically appropriate.
legend
andcaption
If you’re on top of your editorial game, these roles are often (though not always) handled by headings.
fieldset
This is too easily abused … hell, even I abuse it because there’s no easy way to sequester label-control pairs. I’m not convinced that the design oversight doesn’t make
div
equally applicable.label
Have you ever noticed that this element is only truly useful if you have a pointer input device? Yeah, me too.
optgroup
Though not actually obscure, the scope of this element is limited to situations in which the best alternative would be to use empty
option
s as separators.Table containers
As currently implemented, these acquire their greatest usefulness in paginated media — so using them is simply a signal that you’re really on top of your cross-media accessibility game.
acronym
andabbr
Between their relative obscurity, their uneven implementation across user agents, and their limited scope, these really cannot be considered part of a core toolset.
The point to this dissertation (other than the fact that I’ve often thought of prettifying it and submitting that prettified version to A List Apart) is that… folks, HTML ain’t rocket science, folks. At least, not by itself.
No comments:
Post a Comment