Log in

View Full Version : Targetted pseudo-classes



DigitalBrit
06-28-2007, 04:32 AM
Hi

Yes I'm new at this so my apologies for the basic questions.

In the following simple example http://www.digitalbrit.com/html/why.html why is it that the email and google links attract some of the same behaviour as the navigation items? Click the email link to see what I mean.

I thought that by specifically targetting the navigation items this would not cascade to other links, but obviously not. And how best to avoid this??

Second, how do you automatically set a navigation item when opening a page; in my case to trigger the rolled over image?

Any pointers would be appreciated. I thought that I was getting the hang of CSS but obviously not yet.

Regards

mwinter
06-28-2007, 05:52 AM
In the following simple example http://www.digitalbrit.com/html/why.html why is it that the email and google links attract some of the same behaviour as the navigation items? Click the email link to see what I mean.

You seem to think that one can prefix a list of selectors. For instance,



#address a:link, a:visited, a:active {
text-decoration: none;
}

is the same as



#address a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:active {
text-decoration: none;
}

There are an additional four rules that are written like that, and all are presumably unintended.

The first rule above should be:



#address a:link, #address a:visited, #address a:active {
text-decoration: none;
}

I don't understand your second question, so I can't help you there.

DigitalBrit
06-28-2007, 10:20 AM
MWinter - thanks for clearing that up - I can see the mistake now.

Re the second point I think that I am on to a solution.

Cheers