Saturday July 26 2008
Nested lists
I learned something today while coding my teaching portfolio site. I was working on the resume page which has several nested lists and it wasn’t validating. The key to nested lists is that they have to be embedded inside a li tag like this:
<ul>
<li>item one</li>
<li>item two</li>
<li><ul>
<li>subitem one</li>
<li>subitem two</li>
</ul></li>
<li>item threee</li>
</ul>
The above code looks like this:
- item one
- item two
- subitem one
- subitem two
- item threee
The problem is that for some reason the nested lists are not indenting? Why? why?
solved
adding a new selector to the CSS solved the problem - didn’t realize that you needed to set a rule for each level of nesting.
ul ul li { margin-left: 1.5em;}





