美文网首页
css2中的透明

css2中的透明

作者: 琪33 | 来源:发表于2018-04-25 10:53 被阅读0次
 <style>
        .out{
            width: 400px;
            height: 400px;
            background-color: blue;
            margin:100px auto;
            border: 1px solid #000;
            opacity: 0.6;
        }

        .in{
            width: 200px;
            height: 200px;
            background-color: red;
            margin:100px auto;

        }
    </style>
</head>
<body>
<!-- opacity  可以给盒子设置半透明,但是会影响里面子盒子,并且子盒子无法改变透明度 -->
    <div class="out">
        <div class="in"></div>
    </div>
</body>

相关文章

网友评论

      本文标题:css2中的透明

      本文链接:https://www.haomeiwen.com/subject/qpldlftx.html