4.9文本装饰属性

91 阅读1分钟
<!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>Document</title>
	<style>
		div{
			/* 上划线 下划线 删除线 underline下划线 overline上划线 line-through 删除线 */
			text-decoration: overline;
			width: 200px;
			/* height: 200px; */
			background-color: blue;
			/* 水平居中 默认left center right */
			text-align: center;
			/* 垂直居中 行高 line-height=height */
			line-height: 200px;
		}
		p{
			/* 首行缩进文字 2em */
			text-indent: 2em;
			color: yellow;
		}
		section{
			/* 设置形变 可以设置单词全部大写uppercase 全部小写lowercase 首字母大写capitalize 等宽字体full-width */
			text-transform: capitalize;
			/* 设置文本阴影 h-shadow v-shadom blur color */
			text-shadow:-5px -5px 1px red;
		}
	</style>
</head>
<body>
	<section>hello css</section>
	<!-- <section>HELLO CSS</section> -->
	<div>我是一个div</div>
	<p>
		段落标签段落标签段落标签段落标签段落标签段落标签<br>
		段落标签段落标签段落标签段落标签段落标签段落标签
	</p>
</body>
</html>