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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie link question 3

Status
Not open for further replies.

tvrtko

Programmer
Nov 26, 2003
53
HR
How to create link that have underline only when mouse is above it?

Is it possible with html and css only?

Probably stupid question, but please help...
 
the css i use is
Code:
A:link
	{
	color: #233e97;
	font-family: Arial, Verdana;
	text-decoration: none;
	}

A:visited
	{
	color: #233e97;
	font-family: Arial, Verdana;
	text-decoration: none;
	}



A:active
	{
	color: #233e97;
	font-family: Arial, Verdana;
	text-decoration: none;
	}



A:hover
	{
	color: #233e97;
	font-family: Arial, Verdana;
	text-decoration: underline;

	}

change the link and hover text-decoration to the value you want. ie. underline or none.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Code:
<html>
<head>
	<style type="text/css">
		a {
			text-decoration: none;
		}
		a:hover {
			text-decoration: underline;
		}
	</style>
</head>

<body>
	<a href="[URL unfurl="true"]http://www.tek-tips.com/">Link</a>[/URL]
</body>
</html>

Hope this helps,
Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
should w3c have picked up on that foamcow? i see i have the last two back to front, but i get validation on w3c

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
1DMF, they are perfectly valid in any order, however the behavior that they will exhibit will be different depending on the order. Read the notes on anchor pseudo classes here at w3schools:


-kaht

How much you wanna make a bet I can throw a football over them mountains?
sheepico.jpg
 
how far does this darn rabbit hole go - lol, just when you think your getting somewhere, as always thanks kaht.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top