|
Posted by Els on 05/03/06 23:12
sachaburnett@yahoo.com wrote:
> Hi all!
Hello :-)
> 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>
No. You can't nest a <p> inside a <span>. <p> is a block-level
element, and inline elements can't contain block-level elements.
> USING DIV
> <div class="mainText">
>
> <p>Blah blah <span class="blueText">blah</span>
Yup, that's just fine.
> Thank you very much in advance for your help
Nesting spans can be done like so:
<span class="blueText">This is blue, and <span class="italicText">this
is both blue and italicized.</span></span>
--
Els http://locusmeus.com/
[Back to original message]
|