|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Mar 2003
Location: New York city
Posts: 212
|
em or not for font
I've set my font-size to .9em. However, in IE for PC when the viewer changes to font to larger it becomes huge. This doesn't happen in IE for Mac. A friend suggested that the problem is em and that it would be better not to specify a font size. Is he right?
|
|
|
|
|
|
#2 |
|
SitePoint Enthusiast
![]() Join Date: May 2002
Posts: 85
|
em is a not a fixed unit, and as such can be adjusted by the user. px (pixels) are a fixed unit, and can't be altered easily by the user, at least not in IE. So if you really want fixed sizes, change your units to px. However, your average usability zealot will claim that this is a very bad idea, and you should allow users to change font sizes if they want to.
|
|
|
|
|
|
#3 |
|
I am obstructing justice.
![]() Join Date: Jul 2002
Location: Ottawa, Canada
Posts: 1,771
|
Stick with the em, IMO.
IE doesn't support it perfectly right now (as it can get ridiculously large or ridiculously small)... But when you use px and other fixed units, sometimes you make it too small for others. I'd recommend setting a font-size, because you're probably going to want some parts to be slightly bigger. Using the em allows you to maintain proportion, and increase the accessibility of your site. It's still, of course, a matter of opinion. |
|
|
|
|
|
#4 | |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Mar 2003
Location: New York city
Posts: 212
|
Quote:
|
|
|
|
|
|
|
#5 |
|
SitePoint Enthusiast
![]() Join Date: May 2002
Posts: 85
|
|
|
|
|
|
|
#6 |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Mar 2003
Location: New York city
Posts: 212
|
[quote='jetboy']Check out:
http://www.alistapart.com/stories/fear4/[/QUOTE] Seems a little out of date. |
|
|
|
|
|
#7 |
|
100% Windoze-free
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Feb 2003
Location: Ubuntuland
Posts: 2,768
|
Sometimes percentages seem to work better sometimes ems and occasionally a fixed pixel font size does the trick. All depends on your particular needs.
|
|
|
|
|
|
#8 |
|
Ceci n'est pas Zoef
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Nov 2002
Location: Malta
Posts: 1,120
|
The trouble with IE is with em sizes smaller then 1. So the trick is to set a body textsize in % and not to go lower then 1em on your elements.
As recommended by owen Briggs: http://www.thenoodleincident.com/tut...phy/index.html Rik |
|
|
|
|
|
#9 | |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Mar 2003
Location: New York city
Posts: 212
|
Quote:
Jerry |
|
|
|
|
|
|
#10 | |
|
Ceci n'est pas Zoef
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Nov 2002
Location: Malta
Posts: 1,120
|
Quote:
The default font-size (100%, 1em) is just to big, in all browsers, so that's why I like the 'body percent' method. It allows one to have better styled text across most browsers. About NN4.X, that old dinosaur... I don't really style for that browser right now but my guess is that since it is not all that good at inheritance it this method might just not work. Rik |
|
|
|
|
|
|
#11 | |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Mar 2003
Location: New York city
Posts: 212
|
Quote:
|
|
|
|
|
|
|
#12 |
|
3MTA3
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jul 2003
Location: Florida
Posts: 1,030
|
Is the font size cascading upon itself? If a parent element has a font set at 2 em and then the child element is also set for 2 em, then I believe it will actually be 4 em. Are your relative font sizes stacking up? Just a thought...
|
|
|
|
|
|
#13 | |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Mar 2003
Location: New York city
Posts: 212
|
Quote:
body, td.main, ul{ font-size: 100%; font-family: Verdana,Arial,Helvetica,sans-serif; color:#006666; background-color:#ffe6cc; } H1, H2, H3, H4, H5, H6, ul, P{ font-family: Verdana, Arial, Helvetica, sans-serif; color: #006666; } H5.jean{ margin-top: -2.5em; margin-bottom: 0.3em; } H3.theme { margin-top: 0.1em; margin-bottom: 0; } P{ font-size : 1em; font-family: Verdana, Arial, Helvetica ,sans-serif; color: #006666; } A:link{ color: #006666; text-decoration: none; } A:visited{ color: red; text-decoration: none; } A:hover{ display:block; color: yellow; text-decoration: none; background: #006666; } A:active{ color: purple; text-decoration: none; } A.main:link{ color: blue; text-decoration: none; } A.main:visited{ color: red; text-decoration: none; } A.main:hover{ display:inline; color: purple; text-decoration: none; background:none; } A.main: active{ color: purple; text-decoration: none; } td.sidelinks a{ display: block; border: 1.4px solid black; border-color: #006666; padding; 2px; margin-top: 0; padding: 0.6em; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 0.9em; } td.sidelinks { background-color: #ff9966; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 1em; } td.toplinks { background-color: #ff9966; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; font-size:1em; padding: 0; } td.main{ background-color: #ffe6cc; font-family: Verdana, Arial, Helvetica, sans-serif; padding: 2em; max-width: 100px; } HR{ width: 100%; height: 0.4em; color: #006666; P.copyright{ font-size : 1em; font-family: Verdana, Arial, Helvetica ,sans-serif; color: #006666; } |
|
|
|
|
|
|
#14 |
|
Super Ninja Monkey
![]() ![]() ![]() ![]() ![]() Join Date: Dec 2001
Location: Sioux City, Iowa
Posts: 709
|
As far as I know, its not a problem with your code, its just an IE 'bug'. Don't you just love them?
Edit: Or it could be that 0.9em font size you have set for your side links. Is that the part thats getting huge and tiny? |
|
|
|
|
|
#15 |
|
gingham dress, army boots...
![]() Join Date: Apr 2002
Location: Salford / Manchester / UK
Posts: 4,856
|
just a quick note about % vs. em...they're both the same, in most cases (some browsers may have some slight rounding issues with the numbers). 1em = 100%. 0.75em = 75%. 0.5em = 50% etc etc
|
|
|
|
|
|
#16 | |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Mar 2003
Location: New York city
Posts: 212
|
Quote:
|
|
|
|
|
|
|
#17 |
|
CSS Advisor
![]() ![]() ![]() ![]() Join Date: Jan 2003
Location: Hampshire UK
Posts: 27,415
|
Hi,
I'm not sure if this is related to your problem but are you using a doctype as quirks mode will increase the size of the text in tables (and lists) if you specify things like this : Code:
body, td.main, ul{
font-size: 100%;
Paul |
|
|
|
|
|
#18 | |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Mar 2003
Location: New York city
Posts: 212
|
Quote:
|
|
|
|
|
|
|
#19 | |
|
CSS Advisor
![]() ![]() ![]() ![]() Join Date: Jan 2003
Location: Hampshire UK
Posts: 27,415
|
Hi,
Quote:
Paul |
|
|
|
|
|
|
#20 | |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Mar 2003
Location: New York city
Posts: 212
|
Quote:
|
|
|
|
|
|
|
#21 |
|
CSS Advisor
![]() ![]() ![]() ![]() Join Date: Jan 2003
Location: Hampshire UK
Posts: 27,415
|
Have you got a link to the page so we can see the effect? (Or post the html code as you have already listed the CSS)
Paul |
|
|
|
|
|
#22 | |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Mar 2003
Location: New York city
Posts: 212
|
Quote:
|
|
|
|
|
|
|
#23 |
|
SitePoint Evangelist
![]() ![]() ![]() ![]() Join Date: Jul 2003
Location: Dumpsville
Posts: 406
|
Why not use keyword font sizes?? xx-small, x-small,small,medium,large,x-large,xx-large. One problem though. IE5 displays keyword fonts wrong, its the way they set it up. they linked those keywords to the <font size> tag but missed the sizes. So to get around that use tantek method(box model hack)
p{font-size x-small;/*<<size we want for IE5*/ voice-family:"\"}""; voice-family:inherit; font-size:normal;}/*<< font size intended*/ } youll probably have to play with ait a bit but youll get it. one other plus side to keyword fonts: they will never go below 9pt. or is it 9px well one of the two, you can assure it will always be readable |
|
|
|
|
|
#24 | |
|
Ceci n'est pas Zoef
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Nov 2002
Location: Malta
Posts: 1,120
|
On the page I gave you , did you also click through to this page?
Quote:
|
|
|
|
|
|
|
#25 | |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Mar 2003
Location: New York city
Posts: 212
|
Quote:
Jerry |
|
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 01:45.










x-small;/*<<size we want for IE5*/ 


Linear Mode
