Unit III: Adding Styles and Interactivity Using CSS and Javascript Chapter 11: USING CASCADING STYLE SHEETS CSS PROPERTIES: CSS Font Properties
CSS Font Properties The CSS Font Properties allow you to specify the font characteristic such as fonts, font size, font style, etc.
Property Description Example font-family Specifies the font family for text h1{font-family: arial , verdana , sans-serif;} h2{font-family: garamond , serif;} h3{font-family: Courier, monospace ;} font-size Specifies the font size of text Value: pixel, point or percentage h1{font-size: 25px;} h2{font-size: 13pt;} h3{font-size: 115%} font-style Specifies the font style for text Value: normal, oblique, or italic h1{font-style: oblique;} h2{font-style: italic
Property Description Example font-variant Specifies whether or not a text should be displayed in a small-caps font or normal font h1{font-variant: small-caps;} h1{font-variant: normal;} font-weight Specifies the weight of a font to normal or bold h1{font-weight: bold;} h1{font-weight: normal;} font Sets all the font properties in one declaration h1{font: oblique bold 20px “Times New Roman”, sans serif;}
COMPUQUIZ 1. Write the CSS code to set the font to Broadway. 2. Write the CSS code to set the font size to 16pt. 3. Write the CSS code to set the font style to italic. 4. Write the CSS code to set the font to small caps. 5. Write the CSS code to set the font to bold. 6. Write the CSS code to set 1-5 in one declaration.