Jump to content

HTML5 Link Color and Underline


jamesadrian

Recommended Posts

I have recently converted some of my web pages to HTML5. I like it, not least because I don't need a CSS file to get most of what I want. Apparently, everything can be specidied in the HTHM5 doculment itself.

 

I am having trouble discovering how to make a link (and only one particular link) have a hover color (#00FF00) and yet no underline. Everything I have read points to "text decoration none" which eliminates the underline but also eliminates the color.

 

How can these two features be independently controled and override the global specification in the body tag for a single link only?

 

Thank you for your help.

 

Jim Adrian

Link to comment
Share on other sites

You have always been able to specify css within the document itself, but if you have many pages using the same css, its better to link to a css file, rather than insert the same css in each page, easier to maintain especially if changes are made, you only have one place to to make amendment instead of each individual pages.

 

Give anchor link a class name

 

<a href="whateveraddress.html class="link_style01">whatever page</a>

 

a.link_style01:hover {color: #0f0; text-decoration: none;}

Link to comment
Share on other sites

Devoted Member,

 

Is there some way to do this without a CSS file, but within the HTML5 document?

 

<a href="whateveraddress.html class="link_style01">whatever page</a>

 

a.link_style01:hover {color: #0f0; text-decoration: none;}

 

Thank you for your help.

 

Jim Adrian

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...