help ! cannot get hover style to take effect

D

Dave Brown

Hi all,

Hoping someone might be able to shed a little light onto my problem,
I have a page with a linked style sheet and some <A> tags which have the
class HeaderLink. The style headlink is in effect as the links look
as expected but I want to specify the hover style as well so in my
stylesheet I have

..HeaderLink {
blah blah (this works)
}
and
..HeaderLink a:hover {
Blah Blah ( this one doesnt take effect )
}

Any idea why the hover style doesnt take effect ?

Thanks,

Dave
 
S

Steve Pugh

Dave Brown said:
Hoping someone might be able to shed a little light onto my problem,
I have a page with a linked style sheet and some <A> tags which have the
class HeaderLink. The style headlink is in effect as the links look
as expected but I want to specify the hover style as well so in my
stylesheet I have

.HeaderLink {
blah blah (this works)
}
and
.HeaderLink a:hover {
Blah Blah ( this one doesnt take effect )
}

Do you have
<a class="HeaderLink">...</a>
or
<foo class="HeaderLink"><a>...</a></foo>

The first style matches whichever element has class="HeaderLink" but
the second style only matches <a> elements that are inside another
element with class="Headerlink".

Steve
 
T

Toby Inkster

Dave said:
I've been taking the <A class="HeaderLink"> approach.

Then why have you been using:

.HeaderLink a:hover {...}

? That means "hovered links inside an element with class HeaderLink". What
you want is "hovered links with a class HeaderLink":

a.HeaderLink:hover {...}
 
D

Dave Brown

using a.Hearlink:hover has no effect either,
could it be because the link is in a <td>
 
R

rf

Dave Brown

[top posting corrected. Please do not top post in future]
using a.Hearlink:hover has no effect either,
could it be because the link is in a <td>

No.

You must be doing something else wrong. It is now the time for you to supply
a URL pointing to what you have so for.

Hang on, I made a typo in that earlier post.

You *did* use a:Headerlink:hover rather than a:Hearlink:hover didn't you?
 
S

Steve Pugh

Stop top posting or you'll find that a lot of the people here,
including some of the most knowledgeable, will stop helping you.
I've been taking the <A class="HeaderLink"> approach.

Then you second style won't affect anything.

a.HeaderLink:hover is the correct selector to use. If that still
doesn't work you'll need to provide a URL.

Steve
 
D

Dave Brown

Dave said:
Hi all,

Hoping someone might be able to shed a little light onto my problem,
I have a page with a linked style sheet and some <A> tags which have the
class HeaderLink. The style headlink is in effect as the links look as
expected but I want to specify the hover style as well so in my
stylesheet I have

.HeaderLink {
blah blah (this works)
}
and
.HeaderLink a:hover {
Blah Blah ( this one doesnt take effect )
}

Any idea why the hover style doesnt take effect ?

Thanks,

Dave

Thanks All, Got it now... I needed .HeaderLink:hover{...}
I was thinking I still needed a 'a.' somewhere.
Rgds
Dave.
 
E

Els

Dave said:
Thanks All, Got it now... I needed .HeaderLink:hover{...}
I was thinking I still needed a 'a.' somewhere.

Well, it wouldn't be a bad idea to state
a.Headerlink:hover{...}.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top