CSS选择器
作者:互联网
基本选择器:
- 标签名选择器:标签名{}
- id选择器:#id值{}
- class选择器:.class值{}
- 通配选择器:*{}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
/*标签名选择器*/
div{color: blue;}
/*id选择器*/
#i1{color: darkcyan}
/*class选择器*/
.c1{color: blueviolet}
/*通配选择器*/
*{color: cornflowerblue}
</style>
</head>
<body>
<div id="i1">item1</div>
<div id="i2">item2</div>
<div id="i3">item3</div>
<div class="c1 c2">item4</div>
<div class="c1">item5</div>
<div class="c1">item6</div>
</body>
</html>
标签:通配,color,标签,选择器,id,class,CSS 来源: https://www.cnblogs.com/yanwen94/p/15748597.html