Possible Duplicate:
What is the difference between HTML tags DIV and SPAN?
I know when coding HTML, I'm supposed to keep semantics in mind, e.g., h1 needs to be a main header, h2 needs to be a subheader, tables need to be tables, use <em>
for emphasis instead of <i>
, etc. Is there a proper difference between divs and spans except one is a block and the other is in-line?
When I was learning I was told that <span>
's were for styling text mid-line. If I had a small blurb of text that I needed positioned at a certain point in my webpage, one that doesn't warrent a <p>
tag, would I use a span should I stick with div's? What if that text needs to cover two lines (i.e., it needs a width) if it contains nothing but text, what should I use?