Sent by Bryan Loeper on 15 August 2004 20:08
> > That's what I am learning. Instead, divisions should be
> > used.
>
> .... for layout in the absence of an element which better describes the
> semantics of the data.
I think this is where most people get confused. <div>s are not for
layout purposes. They just aren't. Neither are <table>s. Neither
are <h1>s or <ul>s. The markup is there to structure the content of
the document. <div>s come into play when you lack a block level
element for a logical division in your marked up data. If you have
another element available to use, by all means use it. For example:
<div id="nav"><ul>...</ul></div> vs <ul id="nav">...<ul>
Both <div> and <ul> are block level elements, so the first is just redundant.
<div id="header"><h1>...</h1></div> vs <h1 id="header">...</h1> vs <h1>...</h1>
Same principle. <h1> is a block level element, so wrapping it in a
div is redundant. Then we can also take out the id in it, because
practically speaking you should only have ONE <h1> tag in your
document.
CSS selectors are for layout. You take the well-formed marked-up
data, and begin applying presentational information to it via those
selectors. That's the purest form possible.
Now, if you have no concern for anything but a typical 90s usage for
your content (meaning, a classic web page, viewed in IE or NN 6+ on a
800x600 or higher resolution with your right hand grasping your left
ankle), then you can throw all the proper form practices out the
window and do whatever you need to "get 'er done", as they say.
However, it's bulky. It's awkward. And it's unusable by growing
trends of cell phones, PDAs, screen readers, etc. Web design is
getting to the point that, at least for internet purposes (vs
intranet), we have little control over what people use to view the
content, so it is good practice to either just stick soley to
standards-based development (meaning, no hacks or anything. just
pure, valid XHTML and CSS), or try to tackle the quirks for each
possible viewing platform. Most people find a (good? I think so at
least) middle ground by sticking to standards-based and then adding
minimalistic hacks for major platforms such as IE5.5+, etc. Browsers
that are not moving towards compliance seem to be fairly stable for
the time being. Those that are only (should?) get more reliable as
time goes on. Other mediums, such as cell phones, PDAs, and screen
readers are still developing, so it's my personal opinion that we'll
likely see the same gaps in their technology over the next few years
as you can see from IE4 to IE6, for example. I'm willing to sit back
and watch them grow until they've found a stable setup for how they
approach parsing the content, and then when they're happy I'll start
doing for them what I do for users of various browsers and try to
"tailor" their visits.
So, in short. If you don't care about who is using your site, just do
what it takes to get it out there so that you can view it the way you
want. If you want to try and cover all your bases to ensure that no
matter what medium is used to access your content, stick to correctly
structured XHTML and valid CSS with minimalistic hacks. If you want
to be a purist and leave it up to the end user to be using a competent
product, don't use a single hack.
-bryan-
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/