On Jul 14, 2005, at 6:01 AM, victor NOAGBODJI wrote:

Hello,
AFAIK, DIVs are to section a page (maybe I'm wrong, as i'm still a beginner). When learning CSS I use to write things like this:
<div id="title">My Title</div>

One day, I has been told that this is bad, according to web standard accessibility (or something like that) so I was told to do this:
<h1 id="title">My Title</h1>

Now I realise that using the later give me more problems. Because when it's a Div you have to set many attributes. Whereas h1,h2,h3....predifined tags have different preset attributes, that varies even with browsers.
What's do you think of this?

Not the best reason to take that approach.

The reason you should use h1 id="title" instead of div id="title" is semantic. What's in the (X)HTML doc should relate only to the logical structure of the document and have nothing to do with the presentation. Therefore you should use h1 if "My Title" is (as it seems to be) the main headline of the document. Then you attach whatever CSS you need to that id (or even just to h1, which is the way I'd prefer to do it).




Have Fun,
Arlen

------------------------------
In God we trust, all others must supply data

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
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/

Reply via email to