html的opacity透明度跟rgba的区别

<!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>
        .c1{
            background-color: rgba(255,0,0,0.3);/*背景颜色或者字体颜色等单独透明度*/
            height: 100px;
            width: 100px;
        }

        .c2 {
            background-color:rgb(255, 0, 0)
            height: 100px;
            width: 100px;
            /* opacity: 0.3; 整个标签透明度 */
        }

    </style>
</head>
<body>
    <div class="c1">你好</div>
    <div class="c2">我好</div>
</body>
</html>

html的opacity透明度跟rgba的区别

上一篇:Maven全局配置文件settings.xml详解(转)


下一篇:zoj 3822 Domination 概率dp 2014牡丹江站D题