Ulterior Posted September 19, 2012 Share Posted September 19, 2012 Tried tons of different bits of code to attempt to change the color for this hyperlinked text but can't get it right. <a href="PHONESYS.php" class="lab"><span class="top-label"> <span class="label-txt">Telephone Systems</span> </span></a> a:top-label li {color:white;} ...For example, am I close? Link to comment Share on other sites More sharing options...
Ingolme Posted September 19, 2012 Share Posted September 19, 2012 You use a . and not a : to select class names. The element that has the top-label class is the <span>, not the <a> so you have to target a span with that class. I don't know why there's an "li" in your selector, I don't see any <li> tags in your code. All those <span> elements look reduntant as well. Since the <a> element has a class called "lab" you can target it like that. a.lab { color: white; } Link to comment Share on other sites More sharing options...
Ulterior Posted September 19, 2012 Author Share Posted September 19, 2012 You use a . and not a : to select class names. The element that has the top-label class is the <span>, not the <a> so you have to target a span with that class. I don't know why there's an "li" in your selector, I don't see any <li> tags in your code. All those <span> elements look reduntant as well. Since the <a> element has a class called "lab" you can target it like that.a.lab { color: white; } Ok just tried that, the Telephone Systems text is till blue though. Link to comment Share on other sites More sharing options...
Ingolme Posted September 19, 2012 Share Posted September 19, 2012 Maybe the style is being overridden by something else. It would be convenient to find out where, but if you don't want to, you can just add an !important value to the property: a.lab { color: white !important; } Link to comment Share on other sites More sharing options...
Ulterior Posted September 19, 2012 Author Share Posted September 19, 2012 Maybe the style is being overridden by something else. It would be convenient to find out where, but if you don't want to, you can just add an !important value to the property: a.lab { color: white !important; } Yeah I thought about that, tried deleting stuff etc, but couldn't find it. It's a bit of mess in there lol, gonna try and clean it up a bit. That's very useful the !important thing thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now