Home
CSS Font StylesfontSets multiple font attributes with one shortcut. At a minimum the font-size and font-family must be specified in that order. css syntaxfont: font-style font-variant font-weight font-size font-familyfont-familySets a prioritized list of font family names. The last entry should be a generic family such as serif, sans-serif, cursive, fantasy, or monospace. Font names containing a space must be quoted. Serif fonts have a small ornimentation at the ends of a letter which improves legibility for large text or printed material. Sans-serif fonts are easier to read with small fonts on computer displays. Monospace fonts are used for computer code so that columns line up. Cursive fonts mimic cursive or calligraphic hand writing. Fantasy fonts are extremely decorative fonts. css syntaxfont-family: font-familyexamplefont-family: Arial, Helvetica, sans-seriffont-sizeSets the size of an elements text. Font size may be either set in absolute terms using resolution dependent px units, resolution independent pt units, browser dependend absolute constants, or in relative terms using em units or browser dependent constants. css syntaxfont-size: sizeFont size may be set using browser dependent absolute constants which corrospond to the old font-size values 1-7. Examplefont-size: xx-small | x-small | small | medium | large | x-large | xx-largeFont size may be set using browser dependent relative constants. Examplefont-size: smaller | largerFont sizes may be set in 'em' units, 'pt' points, or 'px' pixels. There are advantages and disadvantages to each. Points are theoretically resolution independent. A 12pt font should render the same on a 72 pixel-per-inch monitor as on a 1200 pixel-per-inch laser printer. Fonts specified in 'em' units are relative to the parent element. To avoid inconsistent presentation due to differing browser defaults, the font size for the body element should be set using absolute units such as pixels or points. Examplesfont-size: 12pt
|
|