12文字属性
2.文字属性:
1) font-size: 文字大小.
常用单位:
[1] px: 像素
[2] em: 以父元素文字大小为基础, 按照倍数显示. 例: 1.5em, 0.8em
[3] rem: 以页面基础文字大小作为参照, 按照倍数显示.
2) font-weight: 文字粗细
值:
[1] bold/bolder: 加粗. 大约于900效果一致. 常用
[2] lighter: 变细.
[3] 100, 200, 300, ..., 900: 100最细, 900最粗
3) font-style: 文字风格.
值:
[1] italic: 斜体. 常用
4) font-family: 文字字体
值: office中可以使用字体名基本都可以使用
<head>
<meta charset="UTF-8">
<title>文字属性</title>
<style>
.first{
font-size: 20px;
font-weight: bolder;
}
.secend{
font-size: 1rem;
font-weight: lighter;
}
.seried{
font-size: 30px;
font-weight: 100;
font-style: italic;
font-family: "Nirmala UI";
}
</style>
</head>
<body>
<div class="first">测试数据1</div>
<div class="secend">测试数据2</div>
<div class="seried">Lyda Suyu</div>
</body>