WordPress.org

Ready to get started?Download WordPress

Forums

Display subcategories with some left-margin? (2 posts)

  1. snobben
    Member
    Posted 9 years ago #

    I wan't my navigation to look like this:

    Parent category
    - Child
    - Child
    - Child

    But I don't success doing this. Does anyone know how to do the magic?

    // Emil

  2. lyklev
    Member
    Posted 9 years ago #

    The best way to do anything like this is to look at the source, or even better, the DOM-inspector in Firefox. The DOM-inspector allows you to point at an element and see the structure of the nested classes/id's. In your case, a child will probably look like this:

    #sidebar ul li ul li ul li

    meaning sidebar -> list (all sidebar sections) -> list-item (one sidebar section) -> ul (categories) -> li (category) -> ul (subcategories) -> li (subcategory).

    In style.css, give this tag a small left margin:
    `#sidebar ul li ul li ul li {
    margin-left : 1em;
    }

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.