Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Brian Robertson
May 21, 2007, 11:16 pmrate this thread
What about the explanation at a super well known web
informational site claiming human communal omniscience:
"In HTML and XHTML, span and div tags are used to describe
content that cannot be properly described by other, more semantic
tags. The div tag defines a division or section within an HTML or
XHTML document, hence its name, div."
Brian, div and span tags are basically containers to put content into.
You can attach styles to these tags which will effect everything
inside the tags. The main difference between div and span tags is that
by default, div tags display in a block whereas span tags display
inline with whatever else is around them. ie When you put something
into a div, it's automatically displayed on a line on its own. When
you put something into a span, it does not effect the layout until you
begin to add styles.
Hope that helps,
Well no, for most content other preferable tags exist, like <P> and
<H1>--H6> and <UL>. DIV tags are meant for grouping block elements into
logical divisions of the document, and SPANS are there, if I recall
right, to create CSS hooks into short sections of text for various
effects, though it's usefulness in general is questionable, I think.
Using all DIVs in place of semantically appropriate titles is just as
bad as using tables for layout. It even has a name you can google for :
Thanks everyone. Yes, that DOES explain it and itís so simple.
You know, I really do despair of most books about computers/programming.
Iíve had a computer for 10 years now and I still sometimes struggle with
the most basic concepts simply because they are so badly explained.
Such is life. Thanks again.