html学习-04(css)

css的外部样式表、内部样式表及内联样式。

<html>
	<head>
		<style type="text/css">
			p {text-align: center;}
		</style>
		<link rel="stylesheet" type="text/css" href="../css/html-004.css">
	</head>
	<body>
		<h1>h1用了外链css,字体大小为30px,颜色为红色</h1>
		<br />
		<p>p标签用了内部样式表,字体居中</p>
		<p style="color: red;">该p标签需要为特殊样式,当不发生冲突时,保留样式表的属性</p>
		<p style="color: red; text-align: left;">该p标签需要为特殊样式,当发生冲突时,以当前标签属性为准。</p>
	</body>
</html>

css样式

h1 {
	font-size: 30px;
	color: red;
	}


发布了7 篇原创文章 · 获赞 0 · 访问量 216

猜你喜欢

转载自blog.csdn.net/qq_37961252/article/details/80140350
今日推荐