Share this Page URL

Glossary - Pg. 255

256 Learn HTML 4 In a Weekend Setting Font Sizes Using Ems While pixel measurements are relative to the screen resolution, em meas- urements set font sizes relative to the parent element's font size. This allows you to set a font size that will scale up or down with the base font size, for instance. Set the H2 element to a size of two ems (see Figure 8.4): h2 { color: #ff6600; background: transparent; font-size: 2em; } In this case, the element's font size is set to two times the default base font size, since it is nested directly inside of the BODY element. If an H2 element were nested inside of another element (a DIV element, for instance), its size would then be scaled relative to that element's font size (the parent element's font size).