Jump to content


Photo
- - - - -

Navbar Active Personalization

navbar active personalization hover css

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1 lpandolfino

lpandolfino

    Newbie

  • Members
  • 6 posts

Posted 20 November 2012 - 03:44 PM

Hi, I'm using the last PageLines framework on WordPress 3.4.2.

On the website

Please Login or Register to see this Hidden Content

I'm using the classic NavBar but I need to have different colour for background and text with the Active state.
With this custom code I can change the NavBar for all the states:

.navbar .navline a {
background-color: #70b8dd;
font-color: #FFFFFF;
text-decoration: none;


But for the active I haven't found the correct code.

Thanks :)

#2 lpandolfino

lpandolfino

    Newbie

  • Members
  • 6 posts

Posted 20 November 2012 - 06:29 PM

OK, I think I am near to the solution... but I need you help :)


#site .navbar .navline li a:active {
background-color: #70b8dd;
color: #FFFFFF;
text-decoration: none;
}

But now I need the colours remains on the page I am looking.

#3 catrina

catrina

    Advocate

  • Members
  • 12345 posts

Posted 20 November 2012 - 06:36 PM

To change the link color for an active page, you'll need to add the body class page ID for that page and the link item class in the CSS. For example:

Please Login or Register to see this Hidden Content


body.page-id-# = The body class page ID for the specific page (you can find it in the body tag)
li.page-item-# = The class looks something like this (you find it using Firebug:

Please Login or Register to see this Hidden Content

)

#4 lpandolfino

lpandolfino

    Newbie

  • Members
  • 6 posts

Posted 20 November 2012 - 06:50 PM

I edited... solved!


body.page-id-38 #site .navbar .navline li.page-item-38 a {
background-color: #70b8dd;
color: #FFFFFF;
text-decoration: none;
}

So when I am on the single page the link on the navbar has font and background different than the others.

Catrina you are the best! :)

#5 catrina

catrina

    Advocate

  • Members
  • 12345 posts

Posted 20 November 2012 - 07:22 PM

You're welcome and yes, and you just repeat the same process for the other pages.