![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Beginner Tip:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SIZE value | Point size |
|---|---|
| size="1" | 8pt |
| size="2" | 10pt |
| size="3" | 12pt |
| size="4" | 14pt |
| size="5" | 18pt |
| size="6" | 24pt |
| size="7" | 36pt |
Set the font value like this:
You can also use relative values:
This displays a font size that's two times larger than the default size. A relative value helps to maintain the hierarchal relationships between page elements. For example, an H1 tag set to a size of +3 will also be larger than an H2 tag set to +2 or a paragraph tag that displays in the default size.
Style sheets have three main advantages that we've covered in detail in previous Webmaster Tips. These make CSS a better alternative to FONT tags to control text size.
FONT tags limit your options while CSS offer a much wider variety of measurement units to specify font size:
| Unit of measure | Abbreviation | Description |
|---|---|---|
| Centimeter | Cm | Standard metric centimeter that you would find on a ruler. |
| Em | Em | Equals the width of the capital letter "M" in the current font. |
| Ex | Ex | Equals the height of the lower-case letter "x" in the current font. |
| Inch | In | Standard U.S. inch that you would find on a ruler. |
| Millimeter | Mm | Standard metric millimeter that you would find on a ruler. |
| Relative | % | Font size is relative to the base font size and is set in percentage values. For example a font size set to 125% equals a font size that's 25% larger than the base font size. A font size set to 50% is half the size of the base font size. |
| Pica | Pc | Standard unit for print publishing. Equals 12 points. |
| Pixel | Px | The size of a pixel on the current screen. |
| Point | Pt | Standard unit for print publishing. 72 points equal 1 inch. |
The most commonly used values are Pixel and Relative sizes, but you'll probably use almost all of them as you gain more Web design experience.
It's important to understand just how these different units of measure are going to display and render in various browsers, else you could get some really unexpected results!
For instance, someone from the United States might select the "inch" unit because she's more comfortable with that familiar scale. Without thinking, she sets the font-style property to equal "1in" and gets this result on the Web page:
It certainly stands out, but that's about the only positive comment you can make.
Experiment a bit to get the text effect you're looking for. Let's get a better idea of just how these options look in a browser:
| Unit of Measure | Web page display |
|---|---|
| Centimeter | Text at .3cm |
| Em | Text at 1.2em |
| Ex | Text at 2ex |
| Inch | Text at .33in |
| Millimeter | Text at 5mm |
| Relative | Text at 150% |
| Pica | Text at 2pc |
| Pixel | Text at 10px |
| Point | Text at 14pt |
Remember that page display doesn't just refer to how the page displays on your personal screen. There's no way to create an HTML page that's guaranteed to look "exactly the same" in all browsers, operating systems, and delivery devices. You will never have absolute control over display unless you convert all HTML files into PDF documents. The best you can hope for is to create pages that are both usable and legible to all visitors.
With that in mind, remember these few details:
NetMechanic's Browser Photo tool helps you quickly identify browser issues and display problems like these. You'll see actual screen shots of your Web page in 16 different browser, screen resolution, and operating system combinations.
With Browser Photo, you can duplicate the user experience of many visitors and correct text display problems before the drive away your customers.
Webmaster Tutorials |
Webmaster
|
Quick SearchSearch our newsletter archives by keyword phrase. |
Volume 7 (2004) Volume 6 (2003) Volume 5 (2002)
|
|