Font sizes.

They have: 2 posts

Joined: May 2001

I am having a problem with font sizes appearing to large on some computers, and to small on other computers, due to the font settings in the users browser. How can I make a website font friendly on any browser no matter what there settings are? Is there a way to overwrite these settings? Any help would be greatly appreciated.

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

Well, what you can do is use a style sheet to define absolute font sizes like this:

p {font-size: 12pt;}

The problem with this is that there are people who use large fonts for a good reason, and using an absolute font size may cause problems for them.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Using stylesheets has different results in different browsers, and can lead to MORE discrepancy if you declare the font size in points or em or even %.

alistapart.com/stories/fear4/

Fear of Stylesheets Part 4

While px does mean some people using older browsers will not be able to change the size of their fonts for their own needs, it does resolve the issues of cross-browser, cross-OS variations that cause even regular viewers to have HUGE issues with being able to read/see the text.

Smiling Suzanne

They have: 11 posts

Joined: Jun 2001

you could convert the whole text box to an image if you like

Busy's picture

He has: 6,151 posts

Joined: May 2001

don't declare font sizes at all. (let their browsers use defaults)

is the default in most browsers, stylesheets dont have a default.

style sheets arent widely supported and in some parts, including fonts wont even work in the main two browsers, I say forget about CSS, its a wasted mission, as is XHTML, maybe in 5 years when there is more chance of people getting rid of the 3,4 and 5 version browsers.

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

Do you find that a lot of your visitors are using version 3 browsers? I usually only have one or two per month, so I really don't care if my sites don't look right to those few people. V. 4 and 5 browsers do support CSS well enough so I don't see why you say they're not widely supported yet. No, they don't support it right according to the standard but it's fine for font changes and stuff like that. Many sites have successfully used CSS extensively.

Yeah, they can be a bit of a pain in netscape, but overall it's worth the effort - much better than cluttering things up with eighteen million font tags.

Just IMHO

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

I agree with Megan. It's also very usefull when you use an external CSS file. You can change your mind later, and update the whole site by editing one file.

Mark Hensler
If there is no answer on Google, then there is no question.

They have: 105 posts

Joined: Jun 2001

body {font-size: 14px}
This should do it, I apears the same on every computer. Exept if the resolution is different, but that wil stay a problem.

Jack Michaelson's picture

He has: 1,733 posts

Joined: Dec 1999

you could write a javascript that loads different external CSSfiles depending which resolution...

They have: 19 posts

Joined: Jun 2001

Same problem I had in the last few days...
Solved it with:

<font face="Verdana, Helvetica, Arial" size="2" CLASS="menu">
'
This is a mixture of all and it works perfect on all platforms and browser-types. Unix-PCs cannot interpret CSS, so they use the size="2", as well as any other type which cannot read CSS. All others use the specified size on CLASS="menu". This tag above is what I use on all my pages.
Keep in mind: On "CLASS" you can do whatever you want, but on "SIZE" never go below size="2".

-- Estacado

They have: 383 posts

Joined: Sep 2000

Quote: Originally posted by Megan Jack
Do you find that a lot of your visitors are using version 3 browsers? I usually only have one or two per month, so I really don't care if my sites don't look right to those few people.

I agree with you in theory however similar standards to what 3.0 browsers supported are now used in other technologies such as WebTV, some wireless and handheld browsers, new web terminals, and other non-Windows operating systems. It's going to be around for while yet.

Style sheets are great but the font tag is not obsolete (use it people!). Using the font tag in combination with style sheets (yes, you have to use pixels) is the best method for now. Getting fonts to display correctly in 3.0, 4.0, 5.0, and now 6.0 browsers should be a challenge that every web developer desires to live up to. Unless my clients has directed me not to make the site compatible (it's happened a few times, usually on first phase development projects where application development is the priority) I don't release a site until it looks good in 3.0, 4.0, 5.0, and now 6.0 browsers. It's a fair amount of work but once you get the hang of things it's pretty straightforward.

I always get scrutinized for my "cross compatibility proves a developer" views however I think any professionals who's been in the field long enough would agree. I can design super sites in Photoshop but until they work in 99.9% of the browsers I haven't proven my skills.

They have: 383 posts

Joined: Sep 2000

Quote: Originally posted by Estacado
Keep in mind: On "CLASS" you can do whatever you want, but on "SIZE" never go below size="2".

Please explain your theory on this.

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

Quote: Originally posted by Estacado

Unix-PCs cannot interpret CSS, so they use the size="2", as well as any other type which cannot read CSS.

Well you need to define Unix. Unix PC's using something like Lynx to connect to the web, don't use stylesheets nor do they support the use of images. Most newer Linux distros have some or full support for stylesheets. Font support or the lack thereof is the main problem with Unix systems and viewing of web pages.

Even though I am a big supporter of Linux/Unix, I still design pages to look good font-wise in the 90% or so of systems that surf using Windows. It is kind of like so many other issues in designing a website like: what resolution, what browser, what OS, etc. You have to consider the smaller minorities but design mostly for the 80-90% crowd.

About the only time that I will use the font tag instead of stylesheets, would be if I have an important or error message that I want to display. Just to make sure that it is visible I will put it in a red font. I think that anyone that uses Homesite would not use the font tag much since it errors on the code check and tells you to use stylesheets.

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

Quote: Originally posted by Adam Oberdorfer
I always get scrutinized for my "cross compatibility proves a developer" views however I think any professionals who's been in the field long enough would agree. I can design super sites in Photoshop but until they work in 99.9% of the browsers I haven't proven my skills.

Maybe we're understanding the subject differently but I just don't see this as a major compatibility issue. I mean, it doesn't matter to me if 1% of my visitors see default Times instead of the desired Arial. It's just not worth my time to insert a whole bunch of font tags just for that. Of course I want to makes sure the site is usable for them, but that's not the same as spending hours and hours trying to make it look exactly the same in every single browser out there. Funcationality and aesthetics are two different things. Does that make me a bad developer? I don't think so.

And of course, if a client wanted it to look exactly the same then I would put in the time and charge him the hours to do that. But when I'm the client and it's my time then hey, it doesn't really matter.

They have: 383 posts

Joined: Sep 2000

I admit broadening my comments to include more then just typeface. And I agree with you to a certain extent, however I still will never use stylesheets alone.

If anyone thought my comments above implied that I consider developers with different views or techniques then I do to be poor developers you misunderstood my intention. To reword my statement I think developers that have the ability to design sites that display on the majority of browsers and degrade gracefully on older browsers to be great developers. I've seen developers who are incredible in the compatibility field and respect them to the fullest extent. Smiling

They have: 19 posts

Joined: Jun 2001

Quote: Originally posted by Adam Oberdorfer

Please explain your theory on this.

Okay. The theory is that Unix PCs (using high resolution and Netscape browsers) don't interpret CSS - that's why they use the size="2" info. Simple: if you go below size="2" on those systems, you won't be able to read anything at all.
And on "normal" (Windows) systems, which take the CSS and skip the size="2" info, you can express any size you like with CSS.
Does that explain my theory?

-- Estacado

They have: 4 posts

Joined: Jul 2001

The major problem when it comes to font sizes is that Netscape displays fonts a bit smaller than IE. Also Macintosh and Windows screens are different.

Here's the best solution:

1. Use style sheets and set font size in pixels ("px"), not "pt". That way, Macintosh and PC will show the ame size.

2. Make another style sheet where all font sizes are 1 pixel bigger.

3. Use Javascript to determine what browser the client is using. If they are using Netscape, use the style sheet with bigger fonts. If they are using anything else, call the default style sheet.

here's an example: http://www.missoulaweb.com

Steven

-----PHP/MySQL Hosting $10 Month-----
-----http://www.missoulaweb.com

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.