text,字体样式前面都加上text-
text-decoration:文本修饰符;
/*
line-through:删除线
overline:上划线
underline:下划线
默认值为none,就啥都没有
text-decoration包含text-decoration-line,
text-decoration-style,text-decoration-color
*/
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>text-decoration的使用(类似删除线)</title>
<style type="text/css">
p{
text-decoration: line-through;
}
</style>
</head>
<body>
<p>民主</p>
</body>
</html>
text-indent:缩放的像素值;
/*
想要默认缩进2行,不建议2倍自己设置字体值大小(如:32px这种)
因为字体值会变化的,建议2em(em是每次匹配浏览器的默认文字大小
)
*/
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>text-indent的使用(首行缩进)</title>
<style type="text/css">
p{
text-indent: line-through;
width: 150px;
height: 150px;
background: red;
text-indent: 2em;
}
</style>
</head>
<body>
<p>社会主义核心价值体系的根本性质和基本特征,反映社会主义核心价值体系的丰富内涵和实践要求</p>
</body>
</html>
color:颜色名/rgb(;;);
/*
特殊在于不用加上text-前缀
默认是黑色
*/
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>color属性的使用</title>
<style type="text/css">
p{
color: skyblue;
}
</style>
</head>
<body>
<p>核心</p>
</body>
</html>
text-align: 水平对齐方向;
/*
light(左对齐),center居中,right(右对齐)
*/
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>text-align的使用</title>
<style type="text/css">
p{
width: 100px;
height: 20px;
background-color: pink;
text-align: center;
}
</style>
</head>
<body>
<p>核心</p>
</body>
</html>