80 likes | 190 Views
Formatting with Style. Chapter 10. Choosing a Font Family. Multi-word fonts require quotes Ex: p {font-family: “Times New Roman”} Use “standard” fonts Specify alternate fonts Ex: p {font-family: Arial, Verdana}. Bold & Italic Fonts. Method 1: Selectors
E N D
Formatting with Style Chapter 10
Choosing a Font Family • Multi-word fonts require quotes • Ex: p {font-family: “Times New Roman”} • Use “standard” fonts • Specify alternate fonts • Ex: p {font-family: Arial, Verdana}
Bold & Italic Fonts Method 1: Selectors p {font-style: italic; font-weight: bold} Method 2: Classes .emph {font-style: italic} .bolded {font-weight: bold} <span class=“emph”>text</span> <span class=“bolded”>text</span>
Font Size • Specify units or % (ex: 12px or 110%) • Use keywords: small, medium, large, x-small, xx-small, x-large, xx-large Method 1: Selectors p {font-size:12pt} Method 2: Classes .bodyfontsize {font-size:12pt} <body class=“bodyfontsize”>
Indentations Method 1: Selectors p {text-indent: 20px} Method 2: Classes .pindent {text-indent: 20px} <p class=“pindent”>
Aligning Text • Alignment can be left, center, right or justify Method 1: Selectors h1,h2 {text-align: center} Method 2: Classes .hcenter {text-align: center} <h1 class=“hcenter”>
Text Decoration • Common values: Blink, line-through, overline, underline, none Method 1: Selectors a:link {text-decoration: none} Method 2: Classes .nodecor {text-decoration: none} .stricken {text-decoration: line-through} <a href=“index.htm” class=“nodecor”> <span class=“stricken”>