gauravc7 Posted June 26, 2006 Share Posted June 26, 2006 I have a table of contents and a index page.the toc, contains heading, sub heading, chapter heading, etc. all are links to the anchor or a page.i want to apply a:link without underlie, a:hover with underline & a:visited same as a:linkhow can i do it.can css be nested . eg. if i had made some style can i use it to define some selectrslike .cstm {font-family:arial}can iuse it to define a:hover??? Link to comment Share on other sites More sharing options...
scott100 Posted June 26, 2006 Share Posted June 26, 2006 yesa.classname:hover (classname = then name of the class)See various examples here: http://www.w3schools.com/css/tryit.asp?filename=trycss_link2 Link to comment Share on other sites More sharing options...
gauravc7 Posted June 26, 2006 Author Share Posted June 26, 2006 a.classname:hover (classname = then name of the class)does not works.cstm{font-family:arial;text-decoration:none;color;red}a.cstm:hover{classname=cstm} or a.cstm:hover{classname=.cstm}a.cstm:hover(classname=.cstm) or a.cstm:hover(classname=cstm)does not workany other method or i may be wrong?? Link to comment Share on other sites More sharing options...
scott100 Posted June 26, 2006 Share Posted June 26, 2006 This is how it should look.a:link applies to all anchor tagsa.one:hover applies to anchors with class one but also inherits a:link style <html><head><style type="text/css">a:link {color: #ff0000; text-decoration: none}a:visited {color: #0000ff; text-decoration: none}a:hover {text-decoration: underline}a.one:hover {background: #66ff66}a.two:hover {font-size: 150%}</style></head><body><a class="one" href="#">This link changes bgcolor</a><br /><a class="two" href="#">This link changes size</a> 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