Forum Moderators: not2easy
.whatever {
font: Verdana;
}
...and then I'll use a pseudo class:
a.whatever:hover {
text-decoration:overline;
}
...and, silly me, I expect the "a.whatever:hover" declaration to...well...DO something. Instead, it'll do nothing at all. So, out of frustration, I'll instead use:
.whatever a:hover {
text-decoration:overline;
}
...and I'll find that it works exactly as I intended the previous declaration ("a.whatever:hover") to work. So, my question is, why the smeg doesn't my previous declaration work? I seem to be doing everything right, so I must have a very fundamental misunderstanding of just what an "a.whatever:[link/visited/active/hover]" type of declaration is supposed to be used for.
Anyone?
ps: This may matter: the "class=whatever" is used within a <div> tag
ps: This may matter: the "class=whatever" is used within a <div> tag
that is exactly it ;)
<div class="foo"><a href="foo.htm">some link</a></div>
is referenced in the CSS:
.foo a:hover {some styles}
<div><a href="foo.htm" class="foo">some link</a></div>
is referenced in the CSS:
a.foo:hover {some styles}
in the first example you are referencing the link through the div class name, in the second you have applied the class name directly to the link.
Suzy
<div class="red bold">text</div>
and this:
<div class="red"><span class="bold">more text</span></div>
require different selectors to match, ".red.bold" and ".red .bold" (note the space) respectively.