font-size/line-height,font-family是必须写的,前两个如果不设置就是默认值
案例:
源代码:
html部分:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>字体风格和样式简写</title>
<link rel="stylesheet" href="./font-style.css">
</head>
<body>
<h1>浠浠呀老师,程序员手速必须要快么?<</h1>
<p class="p1">如果一个程序员在噼里啪啦的敲键盘,他85%可能是在和产品经理battle,或者在和测试打口水仗,还有10%的概率是在论坛上摸鱼,
另外5%可能是在和小姐姐聊天!</p>
<p class="p2">所以工作的时候不需要拼手速?</p>
<p class="p3">其实,battle 也是工作的一部分。</p>
</body>
</html>
css部分:
h1{
font-weight: normal;
}
p.p1{
font-style: normal;
font-weight: bold;
}
p.p2{
font-style:italic ;
font-weight: 700;
}
p.p3{
/* font-style: oblique;
font-weight: 100;
font-variant: small-caps;
font-size: 30px;
line-height: 30px;
font-family: 华文仿宋; */
font:oblique 100 small-caps 30px 30px 华文仿宋;
}