首页 > 代码库 > css初涉

css初涉

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-cn">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title>网页标题</title>
	<meta name="keywords" content="关键字列表" />
	<meta name="description" content="网页描述" />
	<link rel="stylesheet" type="text/css" href="" />
	<style type="text/css">
		*{
			margin:0;
			padding:0;
			color:white;
		 }
		h1{
			color:blue;
		  }
		p{
			color:green;
		 }
		h3{
			color:red;
		  }
		h1,h3{
			text-align:center;
			text-decoration:overline;
		     }
		.div1{
			font-size:x-large !important;
			background-color:silver;
		     }
		#div1{
			font-size:xx-large;
			}
		#main{
			background-color:black;
			 }
	</style>
</head>
<body>
	<div id="main">
		<h1 style="color:yellow">只是一个一级标签</h1>
		<p>只是一个段落</p>
		<h3>这是一个三级标签</h3>
		<div class="div1" id="div1">
			bilibili
		</div>
		<div id="div1">
			dilidili
		</div>
		<!--!important > 标签内style > id选择器 > 类选择器 > 标签选择器 > 通配符选择器-->
	</div>
</body>
</html>

  

css初涉