font family
Each font-family contains a set of fonts that share common characteristics. There are five font families: sans-serif, serif,monospace, cursive, and fantasy. Each family includes a large set of fonts.
Take a good look at the font families: serif fonts have an elegant, traditional look,while sans-serif fonts have a very clean and readable look. Monospace fonts feel like they were typed on a typewriter. Cursive and fantasy fonts have a playful or stylized feel.
body {
font-family: Verdana, Geneva, Arial, sans-serif;
}
按順序依次嘗試 本機有沒有安裝相應的字體,若均沒有,則按默認的sans-serif字體
How to add a Web Font to your page
Find a font;
Make sure you have all the formats of the font you need;
Place your font files on the Web;
Add the @font-face property to your CSS;@font-face {
font-family: "Emblema One";
src: url("http://wickedlysmart.com/hfhtmlcss/chapter8/journal/EmblemaOne-Regular.woff"),
url("http://wickedlysmart.com/hfhtmlcss/chapter8/journal/EmblemaOne-Regular.ttf");
}
Use the font-family name in your CSS;h1 {
font-family: "Emblema One", sans-serif;
}
specify web colors
body {background-color: silver;}
body {background-color: rgb(80%, 40%, 0%);}
body {background-color: rgb(204, 102, 0);}
body {background-color: #cc6600;}