The more complicated answer is that setting font sizes involves not only the mechanics of doing so, but also the advisability of various approaches. For example, if you set all of your text with pixels, you could prevent many users from being able to resize the text (see the entry Force Font Size. Some authors argue that text should not be free to be resized anyway, nor should it be based on the user's default font size (which many designers dismiss as being "way too big and ugly"). The flip side of the debate holds that the user's default settings should always be honored, and that while text can be sized, it should be sized relative to the user's settings. This school of thought, which advocates the use of percentage and em-based font-size values, points out the inherent accessibility advantages of relatively-sized text, which can be easily resized by the user.
h1 {font-size: 150%;
h2 {font-size: 1.5em;} /* same as 150% -- see [[ Using Ems ]] */
h3 {font-size: 18px;} /* a bad idea! see [[ Using Pixels ]] */
h4 {font-size: 12pt;} /* a bad idea! see [[ Using Points ]] */
h5 {font-size: 1ex;} /* approximately same as 0.5em */
|