[thelist] DIV, SPAN

{ schaapy } list01 at theparagon.org
Wed Apr 24 09:12:01 CDT 2002


> What is the difference between DIV and SPAN?  I've always been using <DIV
> CLASS=...> in my pages, but I've been noticing that <SPAN...> appears to
be
> doing the same thing.  Does it?


A div is a block-level element where as the SPAN is an INLINE element.

So what does this mean?

Well - if you use a DIV tag around some text it will control a BLOCK around
the text as well. Meaning that anything else that's not inside the div tag
will get (usually) away by a line break.

A SPAN tag will only control the text and not put a block around your text.

Try making a simple page with 2 paragraph worth of text. With one of the
paragraphs use the div tag for only HALF of the words and the rest not be
held inside a div tag.

With the second paragraph then use the SPAN tag and (same as above) - leave
out some of the text in the 2nd paragraph out of your SPAN tag.

Do that and you should see the difference clearly - If you need any extra
help let me know and I'll throw a page together to show you the difference
:-)

Hope that helps.

---------------------------
Aaron Schaap
www.theparagon.org




More information about the thelist mailing list