Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Konrad Pilch
Konrad Pilch
2,435 Points

WordPress current page color

.current-menu-item > a {
    color:red;
    background: red;
}

Doesnt work.. why, why why, everything other works, but this doesnt.

Do i need to provide more code?

Hi Konrad,

Have you checked in your browsers dev tools if the "current-menu-item" class is being assigned to the correct element? And have you checked if there is another more specific selector that is overriding the selector you have?

Konrad Pilch
Konrad Pilch
2,435 Points

Thank you. Kevin told me about it a bit faster : p

1 Answer

Kevin Korte
Kevin Korte
28,149 Points

Hey Konrad,

We talked about this off of treehouse. You should update your this with what you learned. That way it might help someone else in the future

Konrad Pilch
Konrad Pilch
2,435 Points

The menu or the anchor was overwriten with other styles that were higher than this here.

As there are different types of points like:

style atribute = 1000 id attribute = 100 class attribute = 10 element attribute = 1 !important = instantly win and overwrites.

These points shows in dev tools in css, and they add up.

I could use !important, that would overwrite the whole other styles that were aplied to teh anchor(a) , but i had to be a lot more specifict to do this.