<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>文字属性</title>
<style>
p{
font-style: italic;
font-weight: bold;
font-size: 10px;
font-family:"楷体";
}
</style>
</head>
<body>
<!--
1.规定文字样式的属性
格式:font-style: italic;
取值:
normal : 正常的, 默认就是正常的
italic : 倾斜的
快捷键:
fs font-style: italic;
fsn font-style: normal;
2.规定文字粗细的属性
格式: font-weight: bold;
单词取值:
bold 加粗
bolder 比加粗还要粗
lighter 细线, 默认就是细线
数字取值:
100-900之间整百的数字
400 等同于 normal,而 700 等同于 bold, 而 900 等同于 bolder。
快捷键
fw font-weight:;
fwb font-weight: bold;
fwbr font-weight: bolder;
3.规定文字大小的属性
格式:font-size: 30px;
单位:px(像素 pixel)
注意点: 通过font-size设置大小一定要带单位, 也就是一定要写px
快捷键
fz font-size:;
fz30 font-size: 30px;
4.规定文字字体的属性
格式:font-family:"楷体";
注意点:
1.如果取值是中文, 需要用双引号或者单引号括起来
2.设置的字体必须是用户电脑里面已经安装的字体
快捷键
ff font-family:;
-->
<i>我是文字</i>
<b>我是文字</b>
<p>abc我是段落</p>
</body>
</html>
1 font-style的作用是什么,有哪些取值
改变样式
2 font-weight的作用是什么,有哪些取值
改变粗细
3 font-size的作用是什么,有什么注意点
改变大小
4 font-family的作用是什么,有什么注意点
改变字体