demo8--background-color

<!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
      -->

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值