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-left1.5em;


Sean. inscribed these words of wisdom on Saturday Jul 26, 2008 at 02:36 PM | tags: code |
Commenting is not available in this weblog entry.
logo subscribe to rss
theme forest

About Me

This blog is my journey to professional web design and development. Here I will write about code and things I learn about xhtml, css, javascript, jquery, Expression Engine, Wordpress and any other CMS I need to use in my new career.

I will be adding links to the sidebar as I find useful resources and blogs. I'm also looking forward to getting feedback from other designers and developers. Thanks for dropping by.

Web Design Blogs

Tutorials

Online Resources

Find Work

Stock Imagery

Validators

CMSs

Recently Bookmarked

Tag Cloud

Reading List

Categories

subscribe to rss