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

CSS got me in a knot! >:[

Status
Not open for further replies.

dirtystim

Technical User
Jul 4, 2001
26
GB
Hi there
well my aim is to have all my links different colours as normal but no text decoration, except on hover. Trouble seems to be that as I ONLY want underlining on hover (regardless of wether visited, active or whatever) it seems to override the other instructions.

Can someone do the equivalent of cracking me over the head to wake me up an' show me what I am doing wrong here?!

here's me tiny CSS .. .

================================
a:link { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-style: normal; line-height: normal; font-weight: normal; font-variant: normal; color: #0000CC; text-decoration: none}

a:hover { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-style: normal; line-height: normal; font-weight: normal; font-variant: normal; color: #666666; text-decoration: underline}

a:visited { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-style: normal; line-height: normal; font-weight: normal; font-variant: normal; color: #0000CC; text-decoration: none }

a:active { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-style: normal; line-height: normal; font-weight: normal; font-variant: normal; color: #0000CC; text-decoration: none }

table { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-style: normal; line-height: normal; font-weight: normal; color: #000000; text-decoration: none}

body { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-style: normal; line-height: normal; font-weight: normal; color: #000000; text-decoration: none }

td { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-style: normal; line-height: normal; font-weight: normal; color: #000000; text-decoration: none }

tr { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-style: normal; line-height: normal; font-weight: normal; color: #000000; text-decoration: none }

th { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-style: normal; line-height: normal; font-weight: normal; color: #000000; text-decoration: none }

tt { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-style: normal; line-height: normal; font-weight: normal; color: #000000; text-decoration: none }
textarea { font-family: Arial, Helvetica, sans-serif; font-size: 8pt; font-style: normal; color: #000000; background-image: none}

a { }

address { font-family: Arial, Helvetica, sans-serif; font-size: 8pt; font-style: normal; font-weight: normal; font-variant: normal; color: #000000; text-decoration: none}

 
Hello dirtystim!

I usually do it like this:
1) create a:visited style with attribute text-decoration: none;
2) create custom style, let's say .a;
3) create cascade styles a.a:link and a.a:hover.

Here is the whole example:




<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<style type=&quot;text/css&quot;>
<!--
a:visited { text-decoration: none}
.a { }
a.a:link { text-decoration: none}
a.a:hover { text-decoration: underline}

-->
</style>
</head>

<body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot;>
<p><a href=&quot;1&quot;>111</a></p>
<p><a href=&quot;2&quot;>222</a></p>
<p><a href=&quot;3&quot; class=&quot;a&quot;>333</a></p>
<p><a href=&quot;4&quot; class=&quot;a&quot;>444</a> </p>
</body>
</html>

Try it, I think it should help!

Good Luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top