|
Posted by David Dorward on 05/03/06 23:16
sachaburnett@yahoo.com wrote:
> I've been searching the Net for an explanation of the DIV versus SPAN
> issue but can't get a clear answer. I understand the DIV is
> block-level whereas SPAN is inline, but is it possible to nest SPAN
> tags?
Yes
> For example, both result in the same output, but which is technically
> correct:
>
> USING SPAN
> <span class="mainText">
>
> <p>Blah blah <span class="blueText">blah</span> blah blah blah blah
> blah blah blah blah blah blah blah blah blah blah blah blah.</p>
P elements may not be contained without SPAN elements. Different browsers
will error correct in different ways, so some will act like they assume you
intended the span to be a div, and some will act like they assume you close
the span before opening the paragraph.
http://validator.w3.org/ is a useful tool.
> <p>Blah blah blah blah <span class="redText">blah blah </span>
That span would probably be better off being an <em> or <strong>.
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Navigation:
[Reply to this message]
|