Jump to content

Styling the text-decoration property


tijs

Recommended Posts

Good evening everybody,

I have a little problem, I've read on the site from w3-schools that I can use a

 text-decoration-color

element to choose a color for the text-decoration (:underline;)

 

Now, I tried it out but it won't work.

#google:link{color:red; text-decoration:underline; text-decoration-color: green;}

Thanks for watching!

 

Tijs

Link to comment
Share on other sites

Ok thanks it worked!

But if I place it in the navbar in bootstrap then it won't work, even if I just put another color, it has no effect..

<li class="active department"><a href="#"> Home </a> </li>.department{color:red;}

Any solutions?

Thanks a lot!

(and by the way, does anyone know where I can learn more advanced styling like this? some tutorial or somthing?)

Edited by tijs
Link to comment
Share on other sites

That probably is not working because the anchor has a color overiding the color applied to li with class 'department', that is why you use span, as it will be the same width to text, but! by using a border and not underline its color is not tied to the color used on anchor. Also it more than likely that the anchor link is a block element that fills the whole area of LI element, so applying a border to that will mean a border will appear at bottom inner edge of LI

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...