类标签器 选择某几个标签;
.类名 {
属性1: 属性值1;
``````
}
class="类名" 类名不能起为标签名 不能纯数字或有中午
将class= xxx 加到要改的标签中;
background-color 背景颜色
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.red {
width: 100px;
height: 100px;
background-color: red;
}
.pink {
width: 100px;
height: 100px;
background-color: pink;
}
</style>
</head>
<body>
<div class="red">红色</div>
<div class="pink">粉色</div>
</body>
</html>