CSS在线手册:http://css.cuishifeng.cn/
CSS命名规则:https://www.cnblogs.com/makai/p/9002898.html
字体属性
1、字体加粗
font-weight:normal | bold | bolder | lighter | <integer>
normal:正常的字体。相当于数字值400
bold:粗体。相当于数字值700
bolder:定义比继承值更重的值
lighter:定义比继承值更轻的值
<integer>:
用数字表示文本字体粗细。取值范围:100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
2、字体倾斜
font-style:normal | italic | oblique
normal:指定文本字体样式为正常的字体
italic:指定文本字体样式为斜体。对于没有设计斜体的特殊字体,如果要使用斜体外观将应用oblique
oblique:指定文本字体样式为倾斜的字体。人为的使文字倾斜,而不是去选取字体中的斜体字
3、字体综合设定
(顺序不能乱调,各个属性用空格隔开,必须保留font-size,font-family属性)
font:[ [ <' font-style '> || <' font-variant '> || <' font-weight '> ]? <' font-size '> [ / <' line-height '> ]? <' font-family '> ]
<' font-style '>:
指定文本字体样式(是否倾斜)
<' font-variant '>:
指定文本是否为小型的大写字母
<' font-weight '>:
指定文本字体的粗细(是否加粗)
<' font-size '>:
指定文本字体尺寸
<' line-height '>:
指定文本字体的行高
<' font-family '>:
指定文本使用某个字体或字体序列
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
h1 {
color:red; /*颜色属性*/
font-size: 30px; /*字体大小属性*/
font-family:"微软雅黑"; /*字体格式*/
}
span {
font-size: 100px;
font-weight: 900; /***1、字体加粗***/
}
strong {
font-weight: normal;
font-style: italic; /***2、字体倾斜***/
}
h2 {
color: blue;
font: oblique bold 20px "微软雅黑";
/***3、字体综合设定***/
}
</style>
</head>
<body>
<h1>中学语文课本</h1>
<p><span>离骚</span><br>
<strong>路漫漫其修远兮</strong><br>
<strong>吾将上下而求索</strong><br>
<em>我是一个斜体</em> <!--em 和 font-style: italic相同功能-->
</p>
<h2>中学数学课本</h2>
<h2>中学英语课本</h2>
<h2>中学物理课本</h2>
<h2>中学化学课本</h2>
</body>
</html>