Forum Moderators: open

Message Too Old, No Replies

<font size=1-7> vs. Font Size in Pixels

         

peterinwa

2:47 pm on Aug 22, 2003 (gmt 0)

10+ Year Member



I have been creating websites for years and to date have always specified font sizes with the 7 HTML font sizes: <font size=1-7>

Of course my pages look different with different browsers, especially if a user changes their default browser settings to increase or decrease font sizes.

In addition, especially now with Netscape 7.1 -- even with using the browser's default settings -- the fonts appear very small.

Previously I was using simple text for all my links. But to make my pages look a little more professional, I create all new links in gif format.

I was surprised to then see that using different browsers my pages look much more similar. The reason being that all the browsers display the graphics (gifs) exactly the same.

Because gifs are an exact number of pixels in size, this got me thinking:

If I were to specify my font sizes in pixels (rather than sizes 1-7) would they look more consistent with the different browsers? Would they actually all be the same height with any browser?

And a second and separate question... would users still be able to make them larger or smaller by changing their browser settings? Or would they always be displayed at their stated pixel height?

Thanks, and any light you can shed on using pixels to specify font size will be most helpful.

Peter

MatthewHSE

3:54 pm on Aug 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



First, you're correct in assuming that setting a font size in pixels will make it look the same in all browsers (at least that's my understanding). However, users will not be able to resize your text according to their needs since pixels is a fixed size.

Second, since you mention the <font> tag, I assume you're not using CSS? If not, you should really look into that. Using CSS is extremely simple, makes it a snap to make site-wide changes to font sizes, colors, etc., and can significantly reduce your page size and thus make your site load faster. It's also better for search engine optimization.

Once you get into CSS, you'll find that the <font> tag, now deprecated by the W3C, is a thing of the past! :)

Go to [w3schools.com ] for more information about CSS.

peterinwa

4:04 pm on Aug 22, 2003 (gmt 0)

10+ Year Member



Thanks, that's just what I want. I don't want the user to be able to change it as it could cause the page to fail to fit.

About CSS... I kinda invented my own form of CSS, using JavaScript to define font sizes and such and then just calling that JS code. Then I was forced to use CSS to control the font size in text input boxes. Works great!

So now I'll have to finally go back to school and study CSS as I really do want that control!

Thanks, Peter

Cenuij

4:15 pm on Aug 22, 2003 (gmt 0)

10+ Year Member



Also, If you switch to CSS, highly reccomended, then i would suggest using a base size in pixels for the body element of your document. Then specify indivdiual sizes using ems or % this will keep text sizes across all browsers regardless of whether a user changes their browser preferences.

body {
font-size: 12px;
}

p {
font-size: .9em
}
h1{
font-size: 1.5em
}

moonbather

7:12 pm on Aug 27, 2003 (gmt 0)

10+ Year Member



It used to be said an object sized in px would be a different height/width on Mac screens than on Win owing to the different resolutions (72 and 96 dpi).

I wondered if this was still the case?

MonkeeSage

7:24 pm on Aug 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



NN7 / Mozilla will resize elements set in px units with the zoom feature (Ctrl + +).

Jordan

DrDoc

3:50 pm on Aug 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It used to be said an object sized in px would be a different height/width on Mac screens than on Win owing to the different resolutions (72 and 96 dpi).

I wondered if this was still the case?

All browsers (for Mac) emulate Windows' ppi resolution.