Helping ordinary people create extraordinary websites!
   

When to use CSS Div vs CSS Span?

Thursday, 1st October 2009
by Omar


Can you please let me know when is it better to use CSS divs rather than CSS spans?



phpdreams
A div is a block-level tag where a span is an inline tag. Essentially, a div would be a section of HTML with a newline both before and after it. Where a span would just cover a portion of a line of text just as em, I, or strong would.

Now, that said, you *can* alter the functionality of each via CSS, but that's a bit beside the point.

Sources:

Friday, 9th October 2009
Votes:
27
23

More CSS Help:
» How can I create a three column website layout in CSS?
» How to create 3 column layout using CSS?
» How to use image as textarea background using CSS?
» How can an image be implemented inside a list?
» CSS Background Repeat Horizontally
» What are CSS sprites and how can I use them?
» How to style content container
» Alternate style sheet for https