Font-Family, Color and Background
Basics CSS rule: Selector (multiple separated by, ) Declaration (multiple separated by ; ) Example: p { color: red; } propertyvalue
Inheritance Children inherit declarations from parents
Font Properties font-family font-size font-style font-variant font-weight font (shorthand property)
Fonts selector { font-family: Times, “Lucida Grande”, Verdana, Arial, Helvetica, sans-serif; } Fonts separated by, Fonts used in the order listed Font list:
Generic Font Families serif (e.g., Times New Roman) sans-serif (e.g., Arial) Cursive (e.g., Comic Sans MS) Fantasy (E.G. aLGERIAN) monospace (e.g., Courier) Always specify generic font family (last in list of font-families)
Text Properties color direction line-height letter-spacing text-align text-decoration text-indent text-transform white-space word-spacing
Color Values Color names: color: black; or aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow RGB colors: RGB percentages: color: rgb(0%, 0%, 0%); RGB numbers: color: rgb(0,0,0); RGB hex shorthand: ○ color: #000000; same as ○ color: #000; ○ Color shorthand can only be used to replace paired characters #fc0 = #ffcc00 #ffcc09 no shorthand
Text Properties color direction line-height letter-spacing text-align text-decoration text-indent text-transform white-space word-spacing see:
Color Properties background-color background-image background-repeat background-position background-attachment background (shorthand property)
Background Color Default transparent Not inherited (like all background properties)