字体属性
font-family:"宋体";设置多个字体用逗号隔开
font-size:20px;字体大小,单位像素
font-weight:bold;字体粗细,加粗,bold等价于700
font-style:italic;斜体
复合写法:
font:style weight size/line-height family;不能随意更换顺序,必须有style和size
文本属性
color:red;可以是16进制的,rgb(255,0,0)
text-align:center/left/right;水平居中对齐/左对齐/右对齐
text-decoration:underline/overline;下划线/上划线
text-indent:20px;文本第一行缩进20px
line-height:20px;每一行之间的距离为20px(上下间距变大,上下平分)
css引入方式
内部样式
<head>
<style>
....
</style>
...
</head>
行内样式
<p style="color:red">我是一个段落</p>
外部样式
1.新建一个css文件,把所有css代码放入此文件
2.在html页面中
<head>
<link rel="stylesheet" href="css文件路径">
</head>