1. text-align:
作用:设置文本的排序方式
取值: center居中 left:靠左 right:靠右
2. text-decoration:
作用:一般用于将a标签的下划线去掉
3. text-indent
作用:用于设置文本的缩进
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
.align{
width:300px;
background-color: red;
margin: 0 auto; /*让div居中*/
text-align: center; /* center:让文本在容器中居中 */
}
a{
text-decoration: none; /*取消a标签的下划线*/
}
.indent{
width:300px;
height:300px;
background-color: red;
text-indent: 2em; /*有两个文本缩进*/
}
</style>
</head>
<body>
<div class="align">
四大名著
</div>
<a href="#">导航</a>
<div class="indent">
假作真时真亦假
</div>
</body>
</html>