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

a:hover issue

Status
Not open for further replies.

Troopa

Technical User
Nov 9, 2001
96
GB
Hi,

I have the following css (this is just an extract)

==================================================

a
{
font-family: Arial;
color: #00cc00;
text-decoration: none
}

a:hover
{
color: #C0C0C0;
text-decoration: underline
}

.plaina
{
font-family: Verdana;
font-size: 8pt;
font-weight: bold;
color: #6699FF;
text-transform: capitalize;
font-variant: small-caps
}

.plaina a:hover
{
color: #000000;
}

now the idea was that all the links exept those links that have the plaina class added to it and this would have a black link when hovered over.

This isn't working, anyone know what I'm doing wrong?
 
2 things:

1) It is good practice to add semicolons to the end of each line in your css. Although it may not be 100% necessary (functionality-wise) to put a semicolon after the last line, it will prevent headaches down the road when you add an additional style that is not applied because the style above it does not have a semicolon at the end of the line

2) Your hover style for .plaina is incorrect. What is says now is turn an anchor black when it is hovered over and has a parent element with a class of "plaina". What you want is the element with a class of "plaina" itself to turn black. So, try this:
Code:
[!]a.plaina:hover[/!]
{
    color: #000000;
}

-kaht

Looking for a puppy?

[small]Silky Terriers are small, relatively odorless dogs that shed no fur and make great indoor pets.[/small]
 
nice one guys, i see the error of my way ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top