Forum Moderators: not2easy

Message Too Old, No Replies

Font size using CSS?

Trying to get right effect.

         

hymer

11:56 pm on Aug 26, 2004 (gmt 0)

10+ Year Member



Hello Everyone,

I have a page <snip> that I think looks pretty good.

I am trying to create a cleaner CSS and have a test page <snip>

Can anyone say why I can't match the fonts from the original page? Specifically, the relationship between body font-size and navigation button font-size is off, particularly when you zoom a notch or two. The difference is most prevelant at low resolutions.

I am new to CSS and can't figure out how to match the font sizes. I need baby steps so I can understand :)

Thanks a lot,

Bob

[edited by: SuzyUK at 8:29 am (utc) on Aug. 27, 2004]
[edit reason] ooops sorry no URLS per TOS #13 [webmasterworld.com] [/edit]

SuzyUK

9:03 am on Aug 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi hymer - Welcome to WebmasterWorld!

are you using fixed font sizes, e.g. px
or fluid e.g. ems, percentages?

Suzy

hymer

1:20 pm on Aug 27, 2004 (gmt 0)

10+ Year Member



Hi,

I am using percentages. Here is what I think is the relevant code:

Navigation Buttons:

#right, #left{
font-size: .85em;
width: 20%;
}

Body:

#middle {
margin: 0 20%;
word-spacing: .1em;
}

No font-size specified for body - left at 100%

I want to try and get a good font-size for the navigation buttons in relation to the body font-size.

Thanks a lot,

Bob

SuzyUK

6:21 pm on Aug 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi hymer..


#right, #left{
font-size: .85em;
width: 20%;
}

Body:

#middle {
margin: 0 20%;
word-spacing: .1em;
}

No font-size specified for body - left at 100%

the 0.85em set on the right/left divs should be making them approx 85% of the main body (#middle) size. the middle size is not specified in your example so it should be 100% is that not happening?

If you want to make the whole lot smaller or larger and still be relative to each other you would just need to change the body from 100% to 90% for example..maybe you need to explicitly set 100% on the body..

Suzy

hymer

7:06 pm on Aug 27, 2004 (gmt 0)

10+ Year Member



Thanks Suzy,

I will give it a try. I see what you mean. I'll let you know how it goes.

Bob

hymer

10:35 pm on Aug 31, 2004 (gmt 0)

10+ Year Member



Hello Suzy,

Just to let you know, I solved the problem. All my font-sizes were in em's and had to be changed to %. That's it.

Apparently, IE does not like em's and it changes the zoom characteristics.

Thanks for the help,

Bob

SuzyUK

11:12 am on Sep 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



glad you got it sorted Bob..

IE does not like em's and it changes the zoom characteristics

Yes this is an IE "bug"

But it, IE, handles em's OK if the initial <body> font size is set in a percentage. So if you set 100% there you can happily use em's throughout the rest of the page and IE will "zoom" properly after that.

Suzy