<!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>文本属性</title>
<style>
.p1 { color: red; } /* 文字颜色 */
.p2 { font-family: "华文中宋"; } /* 字体类型 */
.p3 { font-size: 26px; } /* 文字大小 */
.p4 { font-weight: bold; } /* 文字加粗 */
.p5 { font-style: italic; } /* 文字倾斜 */
.p6 { text-indent: 60px; } /* 首行缩进 */
.p7 { text-align: center; } /* 水平对齐方式 */
.p8 { line-height: 100px; } /* 行高 */
.p9 { height: 100px; background-color: gray; line-height: 100px; } /* 利用行高将文字垂直居中 */
.p10 { text-decoration: underline; } /* 文本修饰 */
</style>
</head>
<body>
<ul>
<li class="p1">深圳</li>
<li class="p2">上海</li>
<li class="p3">北京</li>
<li class="p4">广州</li>
<li class="p5">长沙</li>
<li class="p6">杭州</li>
<li class="p7">武汉</li>
<li class="p8">成都</li>
<li class="p9">洛阳</li>
<li class="p10">海口</li>
</ul>
</body>
</html>
CSS文本属性
最新推荐文章于 2023-06-30 16:25:33 发布