Reply to Re: What's wrong with this HTML (fails validation) ?

Your name:

Reply:


Posted by Andy Dingley on 02/19/07 11:53

On 17 Feb, 19:35, rem6...@yahoo.com (robert maas, see http://tinyurl.com/uh3t)
wrote:
> > you can't place bare text on the body of a page. Everything must
> > be inside a <div>, <p> or similar.
>
> Which of those is appropriate for running text that leads into a UL element?

Depends on what you mean by "running text".

If this is what I'd think of as "running text", then it shouldn't
have any specifc markup around it at all. After all, it's just
"running text", purely the content of the text block and running right
into what I presume is an inlined list.

<div>Omnia Gallia in tres partes divisa est <ul>
<li>singulî</ul>
<li>secundus</ul>
<li>tertius</ul>
</ul>
</div>

Note two things about this:

* You need to set the list (ul and li) to display: inline; with CSS.

* It's a <div>, not a <p>. This is because HTML doesn't allow <p> to
contain other block elements (like a list). Although CSS permits an
inline list to be rendered, HTML doesn't really support the concept
natively. HTML lists are block elements.


If you mean "A heading that runs into a UL element without any
linebreak", then mark it up with <h2> etc. just as you'd expect. Then
use CSS and display:inline; to run things together, as needed.

Note that these two cases are semantically different, depending on
what you intend this "running text" to represent. CSS lets them both
be presented identically, but there is a conceptual difference between
them and you ought to preserve this.

[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

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