<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
文本属性
文本颜色
div {
color: deeppink;
color: #ff0000;
color: rgb(255, 0, 0);
}
可以用预定义的颜色值,也可以用16进制、rgb
双击可以从调色盘上选择
文本对齐
div {
text-align: center;
}
属性:left、right、center
文本装饰
div {
text-decoration: underline;
}
a {
text-decoration: none;
/* 取消a下划线 */
}
属性:none默认、underline下划线、overline上划线、line-through删除线
文本缩进
p {
text-indent: 10px;
text-indent: 2em;
}
属性:px——像素、em——当前缩进文字几个文字大小
行间距
body {
line-hight: 26px;
}
行高有上间距与下间距与文本高度,上间距与下间距相等,
一般测第一行的最下沿到第二行的最下沿
</style>
</head>
<body>
<h2>标题</h2>
<p>普通文本1</p>
<p>普通文本2</p>
<a>下划线文本3</a>
</body>
</html>