font-size 字型大小 font-style 斜體 font-weight 字型粗細(100-900,bold / bolder) line-height行高
font-family字型 font簡寫:字型大小/行高 字型
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
.box{
color: #FF0000;
font-family: "微軟雅黑";
}
.a{
color: rgb(0,255,0);
font-family: "新宋體";
}
.a1{
color:rgba(0,0,255,0.3)
font-family:"楷體"
}
.a2{
color: rgba(100%,0%,0%,0.5);
}
p{
font-size: 20px;
}
.a3{
font-style: italic;
}
.p1{
font-weight: 600;
background: lightblue;
line-height: 30px;
}
.p2{
font-weight:lighter;
opacity: 0.5;
background: lightcoral;
font: 30px/35px "楷體"
}
</style>
</head>
<body>
<p class="box">我是p标簽</p>
<p class="a">我是p标簽</p>
<p class="a1">我是p标簽</p>
<p class="a2">我是p标簽</p>
<p class="a3">我是p标簽</p>
<p class="p1">我是p标簽</p>
<p class="p2">我是p标簽</p>
</body>
</html>
運作效果如下: