Reply to Re: DIV vs SPAN

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация