/    Sign up×
Community /Pin to ProfileBookmark

text-decoration:underline problem?

Hi,

To underline my link on mouseover i have asigning this to the a:hover : –

[CODE]
text-decoration:underline;
[/CODE]

It works fine in all browsers, but IE displays it slightly differently. In IE it when you have a letter that goes below the line like “y” the underline property will put a line through the “y”, but in firefox,NS and opera it makes puts it below the “y”.

This creates two minor effects 1. the space between the normal letters and the line is bigger in firefox,ns and opera. But also when u use verticle-align:middle; it is not quite accurate it is about 3-4 px out in the firefox, ns and opera.

Is there a way around this? or is that how it is?

Thanks
k0r54

to post a comment
CSS

8 Comments(s)

Copy linkTweet thisAlerts:
@FangJan 24.2005 — I see no difference, give a code example of the effect.
Copy linkTweet thisAlerts:
@k0r54authorJan 24.2005 — hi,

you appear to be correct :o

Can you explain why on my page, on the 4 links in the gray bit just below the logo it is doin what i explained?

[URL=http://www.privatedemo.apc-compunet.co.uk/webdev/vince/equity.htm]http://www.privatedemo.apc-compunet.co.uk/webdev/vince/equity.htm[/URL]

Thanks

k0r54
Copy linkTweet thisAlerts:
@FangJan 24.2005 — It appears to be a combination of problems:

Setting the font-size in px(not a good idea) gives a slightly different position for the underline. Use em or % units.

The [i]charset=shift_jis[/i] (Japanese) is wrong, use [i]charset=utf-8[/i]
Copy linkTweet thisAlerts:
@k0r54authorJan 24.2005 — Hi, thanks it turned out to be the charset!

Is there a conversion from px to em?

What exactly is em and how can it benifit me and what does the charset do exactly?

Thanks for your help

k0r54
Copy linkTweet thisAlerts:
@NogDogJan 24.2005 — [i]Originally posted by k0r54 [/i]

[B]Hi, thanks it turned out to be the charset!



Is there a conversion from px to em?



What exactly is em and how can it benifit me and what does the charset do exactly?



Thanks for your help

k0r54 [/B]
[/QUOTE]

The "em" is a unit of measure in typesetting which is equal to the size of a capital M in a given font/font-size. (It is often used in typesetting to refer to the size of a space or dash: an em-dash or an em-space, with narrower versions being the en-dash and en-space.)

In CSS, whenever you express a size or dimension in "em" units, you are therefore expressing it in terms of the currently active font stlye/size. This can be very useful in keeping things proportionate to the text if the user increases/decreases font size based on their personal vision needs, monitor size, etc.

So, no, there is no conversion from px to em. Px is an absolute size, em is a relative size (as is percent).
Copy linkTweet thisAlerts:
@k0r54authorJan 24.2005 — great explaination!

Thank you very much ?

There is still so much i need to learn ?

Thank you

k0r54
Copy linkTweet thisAlerts:
@NogDogJan 24.2005 — Just do what I did: work for 3 years at a typesetting company. Then you get to add words like "kerning" and "leading" (pronounced "ledding") to your vocabulary, too. ?
Copy linkTweet thisAlerts:
@FangJan 25.2005 — [URL=http://www.w3.org/International/O-HTTP-charset]charset[/URL]
×

Success!

Help @k0r54 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 5.5,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

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