<!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>
html,body{
width: 100%;
height: 100%;
}/*设置html和body最大百分之百*/
body{
margin: 0;/*使得颜色充满*/
}
</style>
</head>
<body>
<!-- <div style="height: 200px;width: 200px;background-color: rgb(0,0,255);"></div>
<div style="height: 200px;width: 200px;background-color: rgba(0,0,255,0.5);">aaa</div> -->
<div class="dialog" style="height: 100%;width: 100%;background-color:rgba(0, 0, 0,0.1);">
<div class="win" style="width: 300px;height: 300px;background-color: blueviolet;opacity: 1;"></div>
<div class="win" style="width: 300px;height: 300px;background-color: hsl(120,50%,50%)"></div>
<div class="win" style="width: 300px;height: 300px;background-color: hsla(120,50%,50%,0.5)"></div>
</div>
<div style="height: 200px;width: 200px;background-color: #0094ff;"></div>
</body>
</html>
<!-- rgb(0~255,0~255,0~255),分别对应红,绿,蓝,三个0是黑色
rbga(0~255,0~255,0~255,0~1)0~1是透明度 透明度两种写法,一种是rgba,还有一种就是opacity(如果主盒子内使用opacity,那么就会带着里面的子盒子一起变透明,反之rgba不会)
hsl(0~360,0~100%,0~100%) 色调、饱和度、亮度
hsla(0~360,0~100%,0~100%,0~1) 多了一个透明度
alhpa
16进制颜色:0~f*3/0~f*6
-->
demo8--background-color
于 2024-10-17 17:52:02 首次发布