jamesadrian Posted September 1, 2013 Share Posted September 1, 2013 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 More sharing options...
dsonesuk Posted September 1, 2013 Share Posted September 1, 2013 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 More sharing options...
jamesadrian Posted September 1, 2013 Author Share Posted September 1, 2013 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 More sharing options...
dsonesuk Posted September 1, 2013 Share Posted September 1, 2013 Internal Style Sheet http://w3schools.com/css/css_howto.asp Link to comment Share on other sites More sharing options...
jamesadrian Posted September 2, 2013 Author Share Posted September 2, 2013 Internal Style Sheet http://w3schools.com/css/css_howto.asp dsonesuk, Thank you for solving this for me. You have given me a general solution. Jim Adrian 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