chicane
chicane

Reputation: 2081

is this valid CSS?

Im trying to create a class called "deadlink" which is for any link within the GP_Content DIV, would this be valid?

/* unvisited link */           
div.GP_content .deadlink a:link 
{
color:#666666;
border-bottom:1px dotted #000000;

}    

Upvotes: 0

Views: 114

Answers (4)

Taylor D. Edmiston
Taylor D. Edmiston

Reputation: 13016

div.GP_content .deadlink a:link { ... }

What you've written targets all links inside elements of class deadlink which are inside the div. It sounds like what you want is actually to target links of class deadlink inside the div. That would be like this:

div.GP_content a.deadlink:link { ... }

However, from your description, it sounds like you want to target all links within the div. If it is all, rather than specific ones, just use this to target all links within the div:

div.GP_content a:link { ... }

Upvotes: 0

Kobi
Kobi

Reputation: 138017

It is valid, but it works for links inside an element with the class deadlink, inside a <div> with the class GP_content.
May not be what you intend.

Upvotes: 0

MyItchyChin
MyItchyChin

Reputation: 14031

If you intended for your deadlink class to be on the link then you'd want your selector to be the following.

div.GP_content a.deadlink:link 

Upvotes: 2

Justin Niessner
Justin Niessner

Reputation: 245419

I think you want:

div.GP_content a.deadlink:link
{
    color: #666666;
    border-bottom: 1px dotted #000000;
}

Upvotes: 5

Related Questions