Reply to Re: DIV vs SPAN

Your name:

Reply:


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

[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

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