1
CSS Properties: An Introduction
Web Design 1
FONT AND TEXT PROPERTIES
Property Name Description Possible Values
font-family Species the font family for text family-name (specify) or generic-family~ [serif, sans-
serif, cursive, fantasy, monospace]
font-style Species the font style for text normal | italic | oblique
font-weight Species the weight of a font normal | bold | bolder | lighter | 100 | 200 | 300 | 400 |
500 | 600 | 700 | 800 | 900
font-size Species the font size of text absolute-size | relative-size | length | percentage
font-variant Species whether or not a text
should be displayed in a small-caps
font
normal | small-caps
text-decoration Species the decoration added to
text
none | underline | overline | line-through | blink
text-transform Controls the capitalization of text none | capitalize | uppercase | lowercase
text-align Species the horizontal alignment of
text
left | right | center | justify
text-indent Species the indentation of the rst
line in a text-block
length | percentage
text-transform Controls the capitalization of
text
none | capitalize | lowercase | uppercase | inherit
letter-spacing Increases or decreases the space
between characters in a text
length | normal | inherit
word-spacing Increases or decreases the space
between words in a text
length | normal | inherit
line-height Sets the line height normal | number | length | percentage
This is not an exhaustive list of CSS properties, but it covers the ones with which we will work this semester.
CSS SYNTAX
• The CSS syntax is made up of three parts: a selector, a property and a value:
selector {property:value;}
• If the value is multiple words, put quotes around the value:
p {font-family:"sans serif";}
• If you want to specify more than one property, you must separate each property with a semicolon. The exam-
ple below shows how to dene a center aligned paragraph, with a red text color:
p {text-align:center;
color:red;}
• End each style rule with a semi-colon.
Commentaires sur ces manuels