/    Sign up×
Community /Pin to ProfileBookmark

:hover underline not working in FF

Ok, another weird problem…I have a link on one page that is set to underline on hover, it works fine in IE and Opera, but not in FF or Netscape, where is just does nothing. It does the correct thing on :focus and :active.

[code]
#staff a {
font-size: 1.5em;
text-align: center;
color: #000;
text-decoration: none;
}
#staff a:visited {
color: #000;
text-decoration: none;
}
#staff a:focus {
color: #000;
text-decoration: underline;
}
#staff a:hover {
color: #000;
text-decoration: underline;
}
#staff a:active {
color: #999;
text-decoration: none;
}

<div id=”staff”>
<a href=”staff.html”>Staff</a>
</div>
[/code]

Hmm, I just tried that code alone on a new page and it works….so I guess something else on the page is doing it.

I’ve tried just doing the link behavior with a .staff class, it does the same thing. However, when I change the same link to a .nav class, it works fine. Here’s that code:

[code]
a.nav {
color: #000;
text-decoration: underline;
padding: 0;
margin: 0;
}
a.nav:visited {
color: #000;
text-decoration: underline;
}
a.nav:focus {
color: #999;
text-decoration: underline;
}
a.nav:hover {
color: #999;
text-decoration: underline;
}
a.nav:active {
color: #999;
text-decoration: none;
}
[/code]

to post a comment
CSS

8 Comments(s)

Copy linkTweet thisAlerts:
@gwyn779authorMay 20.2005 — After more experimenting, it seems that it only does this when I change the font size to >1em. If I make it larger using px instead of em, it doesn't have a problem. So I can fix it, but why won't it work in the first place?
Copy linkTweet thisAlerts:
@BonRougeMay 20.2005 — There must be another problem on your page, because [URL=http://bonrouge.com/test/staff.htm]your code works fine for me[/URL].
Copy linkTweet thisAlerts:
@FangMay 21.2005 — Buggy

The underline does not work with [I]charset=shift_jis[/I] in FF

Use:&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
The underline in IE remains 'thin' and is not affected by [I]font-size[/I]

Use:#staff a:hover {
color: #000;
border-bottom:8px solid black;
}

The result is not exactly the same as underline in FF. You may need to tweek the margin and padding.
Copy linkTweet thisAlerts:
@BonRougeMay 21.2005 — Buggy

The underline does not work with [I]charset=shift_jis[/I] in FF
[/QUOTE]

Works fine for me - I see no problems at all.
Copy linkTweet thisAlerts:
@FangMay 21.2005 — How is the character encoding set in your browser?
Copy linkTweet thisAlerts:
@BonRougeMay 21.2005 — Auto-detect>Japanese (but when I look at this page it comes up as Western (ISO-8859-1))
Copy linkTweet thisAlerts:
@FangMay 21.2005 — Using [I]Auto-detect>Japanese[/I] will display the underline on your test page.

The default is [I]Auto-detect>(Off)[/I], which does not display the underline.

Only use [I]charset=shift_jis[/I] if content is Japanese.
Copy linkTweet thisAlerts:
@BonRougeMay 21.2005 — I see...
×

Success!

Help @gwyn779 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...