-
Notifications
You must be signed in to change notification settings - Fork 0
/
32颜色取值.html
38 lines (38 loc) · 905 Bytes
/
32颜色取值.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
div {
width: 200px;
height: 200px;
}
/*
关键词:red、blue
rgb: 红绿蓝三原色,0~255
rgba: rgb+透明度 0~1
十六进制: #开头, 数字转化为十六进制 00~FF
*/
.box1{
background-color: red;
}
.box2{
background-color: rgb(0, 255, 0);
}
.box3{
background-color: rgba(0, 0, 255, 0.5);
}
.box4{
background-color: #a957a6;
}
</style>
</head>
<body>
<div class="box1"></div>
<div class="box2"></div>
<div class="box3"></div>
<div class="box4"></div>
</body>
</html>