2 replies [Last post]
SadruddinW
SadruddinW's picture
Offline
Regular
Sheffield
Last seen: 2 years 11 weeks ago
Sheffield
Timezone: GMT+1
Joined: 2007-08-03
Posts: 12
Points: 5

Hi.

I have a menu.

http://sheffieldtrauma.com/aboutmnew.html

I have a class which I want to you JUST for 'current page' on the menu.
So I have a class called main-nav-here

http://sheffieldtrauma.com/traumam.css

So. I've changed the background-color: (I won't be using red in the final release). That works.
BUT whatever I do to the color: it doesn't seem to work.

I expect this is simple, but it's doing my head in.

Any takers?

SW

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 12 hours 34 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9761
Points: 3843

Specificity

This:

.main-nav a {
  border: 1px dotted blue;
  color: #2570e3;
  display: block;
  padding: 5px;
  text-decoration: none;
}

overrides this:

.main-nav-here {
  background-color: red;
  color: #fff;
}

Edit your selector to be .main-nav-here a {...}

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

SadruddinW
SadruddinW's picture
Offline
Regular
Sheffield
Last seen: 2 years 11 weeks ago
Sheffield
Timezone: GMT+1
Joined: 2007-08-03
Posts: 12
Points: 5

Excellent. Ta.

Excellent. Ta.