Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS question

Status
Not open for further replies.

UncleMortis

Programmer
Jan 28, 2003
120
AU
I've haven't made a web page for a month or so and I was fiddling around with one the other day. I had the A and A:hover set so that the hover changed colour. However the hover only worked in my div tag and no where else? Have I forgotten to add to make it go through the whole document.
here's the css file... I normally don't add the visited part of the A but this time my A links were upredictable for some reason and not reacting like they should have.
Code:
body {color:silver;
	background: white url(back_102.jpeg) repeat center center;}

a:link {color:#4169e1;
	  text-decoration:none;}
a:hover {color:#3cb371;
	   text-decoration:none;}
a:visited {color:#4169e1;
	     text-decoration:none;}
div.links { padding: 0.5em;
	     border-style: solid;
	      border-width: 2px;
	       float:right}
p {font-family: papyrus;
		 times roman}
 
Try switching position of a:visited and a:hover. W3Schools state that pseudo class a:hover must come after a:link and a:visited in order to work. Hope that helps
 
i dont think u need a span tag or div tag.
by doing this:
a:link

all <a... will automtically use the style. this type of style is called style for a tag. all tags that has the same name will automatically change...

Known is handfull, Unknown is worldfull
 
I used the div tag so I could move my links about the page easily and keep them together vbkris. I didn't know that there was an order to uphold in css in regard to the different states of the A, Vragabond, I'll keep that in mind next time, as I said, I don't normally use the A:visited, and only use the :hover and the original A. Thanks for the help everyone.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top