Web Hosting Talk







View Full Version : Restricting font size


landphil
10-07-2003, 11:25 AM
In most browsers you can adjust the size of the html fonts up or down, which can really screw up a layout. I have seen sites where this does not happen (i.e. you go to View/TextSize/Largest and the text does NOT change sizes), does anyone no how to control that? (other than making the text an image, that much I know)

jjmac78
10-07-2003, 11:32 AM
Set the size of the font with CSS and they will not change when a user goes to view/text size/whatever.

Example:

<style type="text/css">
td {FONT-SIZE: 10pt}
</sytle>

This will make any text inside a <td> tag 10 point text no matter what the user picks on the browser. Let me know if you're not familiar with CSS and I can give you more instruction on that.

landphil
10-07-2003, 11:35 AM
I have done a bit of CSS for scroll bars and hovers and stuff. I will try this, I was pretty sure it was CSS but now you have confirmed it, thanks so much.........

jjmac78
10-07-2003, 11:51 AM
No problem...

Also here (http://hotwired.lycos.com/webmonkey/authoring/stylesheets/) are some good tutorials on stylesheets (CSS)

AdidasROXX
10-08-2003, 02:41 AM
or you can try here: http://www.w3schools.com/css/default.asp

Alex042
10-08-2003, 08:29 AM
FONT-SIZE: 10pt
or 10px for pixels

bedlam
10-08-2003, 12:49 PM
Originally posted by jjmac78
Set the size of the font with CSS and they will not change when a user goes to view/text size/whatever.

Example:

<style type="text/css">
td {FONT-SIZE: 10pt}
</sytle>

This will make any text inside a <td> tag 10 point text no matter what the user picks on the browser. Let me know if you're not familiar with CSS and I can give you more instruction on that.

...but only in Internet Explorer. Other browsers allow text to be resized no matter what you specify (this is true regardless of whether you use pixels or points). It tends to work better if you avoid layouts that will break if the font size changes.

B

Alex042
10-08-2003, 01:10 PM
Other browsers allow text to be resized no matter what you specify
Maybe because of accessibility reasons. Afterall, some people may have a problem reading small fonts and may have their font sizes set higher so they dont have to worry about this.

bedlam
10-08-2003, 01:17 PM
Yep, that's precisely the reason.

As I say, the most fail-safe strategy is to design layouts that don't break when the font size changes.

;)

B

jjmac78
10-08-2003, 03:51 PM
I agree with bedlam...

But since I read in a microsoft article that only 5% of all browsers are netscape now, (after AOL laid off its mozilla team and switched browsers) i just said forget it -- i'm just coding for IE :)

So I didnt even test netscape when I posted my answer... My apologies..

And in my opinion people should be able to control the font size for the aforementioned reasons.

bedlam
10-08-2003, 04:05 PM
Originally posted by jjmac78
But since I read in a microsoft article that only 5% of all browsers are netscape now, (after AOL laid off its mozilla team and switched browsers) i just said forget it -- i'm just coding for IE :)

I'm a little :topic:, but you may want to rethink that:

Not only has MS discontinued development for Mac IE (see story here (http://maccentral.macworld.com/news/2003/06/13/explorer/)) , it has also discontinued development of IE for Windows as a standalone product (see story here (http://news.com.com/2100-1032_3-1011859.html?tag=fd_top)).

Obviously whatever is integrated into Longhorn (or whatever it's called when it's released) will incorporate technology from IE 6 and people will continue to use older browsers, but If you have to upgrade your whole OS to get the features of the new browser in Longhorn, a lot of people are bound to simply switch browsers instead...

B