<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>css字体属性(字体,大小,粗细,文字样式)</title>
</head>
<style>
h2 {
/* font-family: 'Times New Roman', Times, serif;*/
font-family: 'Microsoft YaHei';
}
p {
font-family: 'Times New Roman', Times, serif;
}
body {
font-size: 16px;
font-weight: 100;
}
/* 标题标签比较特殊,需要单独指定文字大小 */
h2 {
font-size: 30px;
}
.bold{
/* font-weight: bold; */
font-weight: 700;/* 这个700的后面不加单位,等价于bold都是加粗的效果,实际开发中建议用数字 */
/* 400:normal 正常文字*/
}
h2 {
font-style: italic;/* 斜体 */
}
em {
/* 让倾斜的字体不倾斜 */
font-style: normal;
}
div {
/* font-style: italic;
font-size: 16px;
font-weight: 700;
font-family: 'Microsoft yahei'; */
/* 复合属性:简写的方式 节约代码*/
/* font: font-style font-weight font-size/line-height font-family; */
font: italic 700 16px 'Microsoft yahei'/* 必须有文字大小和字体,16px 'Microsoft yahei'不能省略,其他都可以省略 */
}
</style>
<body>
<h2>春晓</h2>
<p class="bold">春眠不觉晓</p>
<p>处处闻啼鸟</p>
<p>夜来风雨声</p>
<p>花落知多少</p>
<em>上课时候的你</em><!-- 平时很少给文字加斜体,反而给斜体标签(em,i)改为不倾斜字体 -->
<br />
<!-- //font属性复合写法 -->
<div>三生三世十里桃花,一心一意百行代码</div>
问:如何让加粗的字体不加粗显示,让倾斜的字体不倾斜显示?
font-size:400 font-style: normal;
</body>
</html>
如何让加粗的字体不加粗显示,让倾斜的字体不倾斜显示?
font-size:400 font-style: normal;