Force Font Size

From CSS Discuss

Jump to: navigation, search

Can I Force Text to Stay a Certain Size?

The short answer is no. A slightly longer answer is yes, but only for certain browsers. And the best answer is: it is not a good idea.

The method by which most authors attempt to force a given font size is with pixels. For example:

td {font-size: 11px;}

This produces a relatively consistent cross-browser and -platform appearance. In addition, it will prevent users of Internet Explorer for Windows (all versions as of this writing) from resizing the text with the "Text Size" option in the "View" menu.

However, any user of any other CSS-capable browser written since 1998 can ignore or override any font size rule the author creates. In Internet Explorer 5 for Macintosh and Gecko-based browsers like Firefox, Sea Monkey , Netscape 6+, Compuserve 7+, and so forth, the user can simply use "Text Zoom" to resize text, even if it has been sized using pixels. In Opera, users can use "Page Zoom", which will resize both text and images. Finally, in IE/Win, motivated users can dig into the "Accessibility" options and check a box to "ignore font sizes specified on web pages". And for all these browsers, it is possible to write a user stylesheet that will override author styles. It is true that the vast majority of users are not aware of these options, but they are always there.

Thus it is not possible to always force font sizing with CSS, no matter what browser is in use. That is why it doesn't always work.

The reason it is not a good idea is that fixed font sizes, especially small ones, can be hard for those without 20/20 vision, and impossible for those with high resolution displays, to read.

Unfortunately, setting the font size in pixels is very common today including many major web sites like hotmail.com. Internet Explorer will not let you resize the text on those web sites. The IE text size menu will just do nothing.

I created a website with javascript bookmarklets that you can install into your IE 'Favorites list' or 'Links Toolbar' that will resize text that IE will not let you by just clicking on the bookmarklet links. It's free and works with 99% of all web pages, go to: http://Bigger-Explorer-Text.com

Personal tools