<html>
<head>
<meta charset="UTF-8">
<title>CSS的基本选择器</title>
<style type="text/css">
p {
background-color: red;
color: yellow;
}
div.div1 {
background-color: blue;
}
div[class="div2"] {
background-color: deeppink;
}
.grayclass {
background-color: gray;
}
p#orangeid {
background-color: orange;
}
#blackid {
background-color: green;
}
* {
background-color: black;
}
h2 {
text-align: center;
}
</style>
</head>
<body>
<h2 align="right">我是标题</h2>
<p><p>标签选择器</p>
<div class="div1">div.div1 选择器</div>
<div class="div2">div[class="div2"] 属性选择器</div>
<div class="grayclass">.grayclass 选择器</div>
<p class="grayclass">.grayclass 选择器</p>
<p id="orangeid">p#orangeid 选择器</p>
<p id="blackid">#blackid 选择器</p>
<div id="blackid">#blackid 选择器</div>
</body>
</html>