PDA

View Full Version : what happend in my list?


blondinnet
10.03.2002, 23:36
i've type a simple list like that
<ul>



<ul>
here it renders me a squared point?

[/list]

[/list]
what is wrong?
I don't change the style in any way, no stylesheets neither inline style!!!
strange I don't understand.
But I'm a beginner
Bye bye

wranlon
12.03.2002, 13:07
Your example is of a nested list, and is invalid. Here's why:

Take a look at the HTML 4.01:(WC3: http://www.w3.org/TR/html4/)

Click lists (#10) in the table of contents (http://www.w3.org/TR/html4/struct/lists.html)

Skip down to section 10.2 and take a look at the first DTD for UL and OL elements.

Both lists can contain one or more list item, LI, but nothing else.

Back to your example. You have:
<pre id=code><font face=courier size=2 id=code>
<ul>
...

...

[/list]
</font id=code></pre id=code>

The ordered list, OL, should not be a direct descendant of UL. Instead, make it a descendent of an LI:

<pre id=code><font face=courier size=2 id=code>
<ul>


Embedded Ordered List Item


[/list]
</font id=code></pre id=code>

Now, the other question was why the style is different. Fixing the HTML should also correct the style. However, note that the user agent (most likely your web browser) decides which style to use for embedded lists, so unless you specify a CSS style for it, you will wind up with whatever the browser uses by default.

Also, if you read into the spec for lists a little bit, you will find the following:

<BLOCKQUOTE id=quote><font size=1 face="Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
We discourage authors from using lists purely as a means of indenting text. This is a stylistic issue and is properly handled by style sheets.
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Arial, Helvetica" size=2 id=quote>

Side Bar Notes for XHTML:

The HTML 4.01 spec was referenced because XHTML is a family of document types that reproduce, subset, and extend HTML 4.

UL, OL, and LI must be lowercase for XHTML.

Stephen W. Cote
wranlon@hotmail.com
http://www.whitefrost.com/