Sean writes:
"So what is wrong with using divs and spans? To me they are a far
better container than the others for the reasons stated above. Just
my 2 cents."
Well, by not using headers, you are making your pages basically irrelevent
to search engines. Not a small drawback... actually, when I first got
started coding CSS, switching over to header tags caused an over 1000%
increase in my search engine traffic. If you have a large amount of pages
where title text is in <div> tags, try switching them to <h1>, and report
back to me in about 2 weeks about how happy you are with your giant increase
in traffic.
Beyond that, all of these tags serve very useful layout functions, and they
help you think about what's happening in your page more clearly. My real
abilities in CSS began when I tossed away span and div. Not to mention, divs
and spans have an unfortunate habit of complexifying the pages.I suggest you
learn you markup better, and toss out spans and divs whenever possible. Your
code will be simpler, your source will be cleaner, and your site will be
less prone to layout problems.
Oh, and goggle (aka god) will smile upon you.
Best.
Nick Lewis
http://nicklewis.smartcampaigns.com
----- Original Message -----
From: "Sean Montgomery" <[EMAIL PROTECTED]>
To: <css-d@lists.css-discuss.org>
Sent: Friday, July 15, 2005 3:42 PM
Subject: Re: [css-d] using of DIVs
Hi,
OK first off I am not trying to start an argument just looking for a
clear concise answer.
I use divs and spans over h1, h2 h3 p etc. I use them for many
reasons some of which are that they are neutral and generic, they have
no extra bagage, they are a clean slate for styling, I don't have to
worry about any predefined styles that come with that particulat tag
like h1, h2, h3, p, etc...
I don't see anywhere where it says that I should use a heading tag
instead of a div for a heading. Granted I did not spend hours looking
but I did take a look.
So what is wrong with using divs and spans? To me they are a far
better container than the others for the reasons stated above. Just
my 2 cents.
Sean
On 7/14/05, Arlen Walker <[EMAIL PROTECTED]> wrote:
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/
--
All constants are variables.
______________________________________________________________________
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/
______________________________________________________________________
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/