WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Extra space after the closing </a> tag in wp_list_cats (4 posts)

  1. Ryan Fitzer
    Member
    Posted 7 years ago #

    Does anyone know anything about an extra space after the ending </a> in the generated HTML from wp_list_cats. When I apply a background color to box it in, there appears to be more space on the right than on the left. My padding and margins are set to 0. Here's what I'm using:

    <?php wp_list_cats('sort_column=ID&hide_empty=0&child_of=1'); ?>

  2. JeremyVisser
    Member
    Posted 7 years ago #

    Are the li's set to display: inline;? If so, the web browser seems to insert a normal ASCII space after each li. I don't know how to fix that one.

    I had a bit of trouble which seems similar to yours but I figured it was that the padding was being applied elsewhere. Can I have a link to the site where you're having the trouble?

  3. Ryan Fitzer
    Member
    Posted 7 years ago #

    Thanks for getting back to me. Boy, that's like a needle in a haystack. No wonder it wasn't happening on site where I floated the li elements. So I'm gonna float from now on! I've since reconfigured the links so that that it doesn't make a difference. But thanks again for that obscure little rule. Here's some very reliable css that I use for horizontal menus.

    #nav {
    height:2.2em;
    padding:0 7px;
    font-size:.85em
    }

    #nav ul {
    list-style:none;
    display:inline;
    }

    #nav ul li {
    float:left;
    }

    #nav a {
    display:block;
    line-height:2.2em;
    padding:0 7px 0 7px;
    }

    The last rule lets you create rollovers that fill the li. Here's the site where I use it http://www.mountainviewcollege.edu/gallery/

  4. JeremyVisser
    Member
    Posted 7 years ago #

    It looks quite nice to me! Has your question been answered? If so, can you do use a favour by marking this support topic as resolved? Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic