WordPress.org

Ready to get started?Download WordPress

Forums

Centering categories list (8 posts)

  1. satoshi
    Member
    Posted 9 years ago #

    I'm having an issue properly centering the categories list on my archives page. I want the list elements to be left aligned, but within a center aligned list. No matter what I try, either the list looks as it is now, or the entire list is on the left side of the page. Is there anyway, short of sticking the list in a table and centering the table, to do this?

  2. Lorelle
    Member
    Posted 9 years ago #

    They are centered, but within the lists. Style your list ul so they don't indent (change to margin:0; padding:0) and see if that helps. They are working the way they are supposed to when you have nested lists.

  3. satoshi
    Member
    Posted 9 years ago #

    But that makes them all centered. That's not what I want. I the list to be centered, but for the list items to be left aligned within the centered list (if that makes any sense). Basically, I want the list to be left aligned, but in the center of the page. And I still want the indents.

  4. Lorelle
    Member
    Posted 9 years ago #

    Then you have to go through the ul li list in your CSS and change the sublists like ul ul ul li {margin:0; padding:0; text-align: left;} or something like that. Nested lists are a pain.

  5. Jinsan
    Member
    Posted 9 years ago #

    looking at your code, you have no tags for ul li or any lists - you also seem to be repeating some tags but in different forms. For example, you can #center which is set to center everything, but then ou've added center to everything else?

    Add a div for your list and you should be able to achieve the alignment you're aiming for

  6. satoshi
    Member
    Posted 9 years ago #

    Jinsan: There are ul and li tags all over the place in that page, in the proper places of course. #center is only around the text that says "Posts sorted by month and by category." I don't know what code you're looking at, but it's not mine. I have separate divs for both the monthly archives and the categories list. (#monthly and #category, respectively)

    Lorelle: Bah, that's too much work =P I'll take a look at that, but there's no guarentee that I have the know-how to make it actually work.

  7. satoshi
    Member
    Posted 9 years ago #

    Aha! Got it! Had to do the following CSS:
    #category ul li {
    margin-left:45%;
    text-align:left;
    }

    #category ul ul li {
    margin-left:15px;
    text-align: left;
    }

    #category ul ul ul li {
    margin-left:15px;
    text-align: left;
    }

    Thanks!

  8. Lorelle
    Member
    Posted 9 years ago #

    Excellent

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.