HTML(3)

来源:互联网 发布:iphone一键越狱软件 编辑:程序博客网 时间:2024/05/17 03:35

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;}

0 0