Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS wp list pages current item CSS

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #30091
    Sheep
    Member

    I’m trying to change the background position to show the current page for my wordpress site. I am using the wp list pages. My current css for a menu item is…

    .page-item-13 {
    width: 157px;
    height: 29px;
    }
    #nav .page-item-13 a {
    position: relative;
    width: 157px;
    height: 29px;
    display: inline;
    float:left;
    background: url(img/nav/rates.png) no-repeat;
    }

    #nav .page-item-13 current_page_item a {
    background-position: 0px -25px;
    background-repeat:no-repeat;
    }

    #nav .page-item-13 a:hover {
    background: url(img/nav/rates.png) 0px -25px no-repeat;
    }

    The hover works fine but the current page item does not. This the html code the php generates for this item is…

    It should be quite basic but I can’t seem to figure it out.

    Any idea?

    #81005
    Darfuria
    Member

    You’re missing the class identifier in front of current_page_item

    #nav .page-item-13 current_page_item a {
    background-position: 0px -25px;
    background-repeat:no-repeat;
    }

    Needs to be

    #nav .page-item-13 .current_page_item a {
    background-position: 0px -25px;
    background-repeat:no-repeat;
    }
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.