Re: problems with validator program?

Nancy Carlin <lila@okkod.pair.com> wrote:

> One thing I'm trying to do is nest <UL> directives.  My O'Reilly
> "Web Design in a Nutshell" book says nesting is OK (page 122).
> 
> 	<UL>
> 		<LI>stuff</LI>
> 		<UL>
> 			<LI>even more stuff</LI>
> 		</UL>
> 	</UL>

That book is wrong.  In HTML 4, the content model of the UL element
is defined as follows, in all DTDs (Strict/Transitional/Frameset).

    <!ELEMENT UL - - (LI)+                 -- unordered list -->

So you have to write something like this:

	<UL>
		<LI>stuff
		<UL>
			<LI>even more stuff</LI>
		</UL></LI>
	</UL>

> The other problem I'm having is that I'm getting the <OL> not allowed
> here in http://www.nancycarlinassociates.com/tea.shtml
> 
> 	Error: element "OL" not allowed here; possible cause is an inline
> 	element containing a block-level element
> 
> The HTML is: (I'm trying to boldface an entire list).
> 	<H2>stuff</H2>
> 	<B>
> 	<OL>
> 	...

The reason is exactly what the validator said.  OL is a block-level
element, and not allowed in B, which is an inline-level element.

> I really hope that the standard does not require me to:
> 	<H2>stuff</H2>
> 	<OL>
> 	<LI><B>aaa</B></LI>
> 	<LI><B>bbb</B></LI>

Use style sheets to control presentation, e.g. the following rule

   OL { font-weight: bolder }

will make an entire list boldface.

Regards,
-- 
Masayasu Ishikawa / mimasa@w3.org
W3C - World Wide Web Consortium

Received on Friday, 13 July 2001 02:52:48 UTC