Forum Moderators: not2easy

Message Too Old, No Replies

IE has problem with nested list items?

         

brunnock

12:51 am on Oct 10, 2007 (gmt 0)

10+ Year Member



Does IE 7 have a nested list item box model problem or is it my code?

Firefox and Safari display the following nested list as 2 separate boxes, but in IE, it shows up as a box in a box.


<html>
<head><title>Nested List Items With Borders</title>
<style>
LI {
margin:1em;
border: 1px solid red;
}
</style>
</head>
<body>
<ul>
<li>hello</li>
<ul><li>goodbye</li></ul>
</ul>
</body></html>

Pointers appreciated.

encyclo

1:12 am on Oct 10, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld brunnock. :)

Your markup is invalid - you have to place a nested list within a list item:

<ul>
<li>hello</li>
[b]<li>[/b]<ul><li>goodbye</li></ul>[b]</li>[/b]
</ul>

See the HTML validator [validator.w3.org] - you can easily get inconsistencies with invalid HTML, as standards don't define error-handling.