Forums

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

Home Forums CSS current page item highlighting troubles

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #30879
    Wendihi
    Member

    Hi, I’m stuck. I want to have the current page link (image) highlighted but I can’t figure out the right css. Really stupid that I can’t find it…

    This is the code on the page

     

    This is the css I have now.

    #menubar{
    width:544px;
    height:39px;
    position:absolute;
    margin:82px 0 0 202px;
    background:url(images/menubg.gif) no-repeat;
    }

    #menubar ul li {
    display: block;
    float: left;
    font-size: 12px;
    list-style: none outside none;
    text-align: center;
    }

    #menubar ul li a {
    color:#000;
    font-weight:bold;
    font-family:"Arial Black", Gadget, sans-serif;
    }

    #menubar #menu-item-30 a {
    color: #008800;
    font-family: "Arial Black",Gadget,sans-serif;
    font-weight: bold;
    height:39px;
    background-image:url(images/tombol-on_01.jpg);
    text-indent:-9999px;
    display:block;
    width:60px;
    padding-right:11px;
    }

    #menubar #menu-item-30 a:hover {
    color:#1d6fc7;
    }

    #menu-item-30 li {
    padding-right:11px;
    display:block;
    }

    #menubar #menu-item-34 a {
    color: #008800;
    font-family: "Arial Black",Gadget,sans-serif;
    font-weight: bold;
    height:39px;
    background-image:url(images/tombol-off_02.jpg);
    text-indent:-9999px;
    display:block;
    width:79px;
    }

    #menubar #menu-item-34 a:hover {
    background-image:url(images/tombol-on_02.jpg);
    }

    #menubar #menu-item-34 current_page_item a {
    color: #008800;
    font-family: "Arial Black",Gadget,sans-serif;
    font-weight: bold;
    height:39px;
    background-image:url(images/tombol-on_02.jpg);
    display:block;
    width:79px;
    }
    #71256
    sylenix
    Member

    usually i do it this way

    CSS

    li
    {
    list-style: none;
    }

    body.section1 #nav li.one,
    body.section2 #nav li.two,
    body.section3 #nav li.three
    {
    background:yellow;
    }

    HTML


    First page


    second page is “section2”,
    third page is “section3”,
    etc…

    #71194
    TheDoc
    Member

    The reason it’s not working is because you don’t have a period in front of the class “current_page_item” in your CSS file.

    Should be:

    #menubar #menu-item-34 .current_page_item a {
    /* Stuff */
    }
    #71177
    loftninja
    Member

    thanks

    #71169
    jsdev
    Member

    @loftninja you have bigger problems than elements above your menu. try selecting anything from your menu it hides as you hover over the links, not giving much time to click one.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘CSS’ is closed to new topics and replies.