代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
#i1{
background-color: blue;
}
.c1{
background-color: beige;
}
span{
background-color: aqua;
}
div span{
background-color: red;
}
#c2,.c3,p{
background-color: black;
color: white;
}
input[type="test"]{
width: 100px;
height: 200px;
}
</style>
</head>
<body>
<div id="i1">id选择器属性</div>
<div class="c1">class选择器属性</div>
<span>标签选择器属性</span>
<div><span>层级选择器</span></div>
<div id="c2">组合选择器的c2</div>
<p>组合选择器的p</p>
<div class="c3">组合选择器的.c3</div>
<input type="test">
</body>
</html>
展示