Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > How to use CSS to lock font size

How to use CSS to lock font size
Thread Tools
Forum Regular
Join Date: Jun 2003
Status: Offline
Reply With Quote
Dec 22, 2003, 12:33 PM
 
With CSS is it possible to lock the font size in all browsers? So that if the user makes the font bigger via the browser the font won't get bigger (ie. for the navigation bars). IE for Windows does that, but coterie to believe not everyone is using IE on Windows.

If so, how is this done?
     
Grizzled Veteran
Join Date: Oct 2003
Status: Offline
Reply With Quote
Dec 22, 2003, 02:52 PM
 
using pt sizes or px sizes should do the trick. em's will change with the browser font size.

Example:
Code:
<p class="thisClass">Some text</p>
and then the css:
Code:
p.thisClass { font-size: 10pt }
Should also note that font PX size and pt sizes are different on different OSes and even different browsers for that matter. I find it is easier to find an appropriate size using pt rather than px for cross browser and cross platform pages.
     
Mac Elite
Join Date: Nov 2003
Location: Minnesota
Status: Offline
Reply With Quote
Dec 22, 2003, 03:36 PM
 
I don't know what browser you are using, but all of the ones I have tested don't do what you say they will with regards to pt and px. Going to View->Increase Text Size or the equivalent makes all of my text bigger, whether it was instantiated with px, pt, or em.
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Dec 22, 2003, 03:57 PM
 
Originally posted by iStudent 2003:
With CSS is it possible to lock the font size in all browsers? So that if the user makes the font bigger via the browser the font won't get bigger (ie. for the navigation bars). IE for Windows does that, but coterie to believe not everyone is using IE on Windows.

If so, how is this done?
This is a bug in IE, not a feature. Users are supposed to be able to make the fonts bigger and/or smaller; this is an accessibility issue.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Dec 23, 2003, 03:21 PM
 
Originally posted by Millennium:
This is a bug in IE, not a feature. Users are supposed to be able to make the fonts bigger and/or smaller; this is an accessibility issue.
Just to take this further, if you want your navigation bars to still look good when resized, have the navigation bar resize as well. If you're not using text for accessibility then the only way to "lock the size" is to use images, which is bad practice.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:35 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2