Alvin John Babu
Alvin John Babu

Reputation: 2070

Inheriting styles from an existing class

I want to design an web page in wordpress. I had a existing class called .current_page_item a {} which is used to highlight the selected menu, I need to add this effect to my menu with id #menu-projects-menu and need to change the font color. When I write .current_page_item a { color: yellow !important; border-bottom: yellow solid 1px !important; } like this in header.php it changes all the anchor tag color in the whole website. Is there any way to change only current page item. NB: I don't have a pro version to write custom css.

Upvotes: 0

Views: 29

Answers (1)

Bilal Ahmed
Bilal Ahmed

Reputation: 257

you can achive this by adding your page unique class before the .current_page_item a like this . you can find it by inspecting the page body tag.

.your_current_page_class .current_page_item a {
    color: yellow !important;
    border-bottom: yellow solid 1px !important;
}

Upvotes: 1

Related Questions