zoukankan      html  css  js  c++  java
  • 第三节 css3动画之透明

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <style type="text/css">
            body{
                background-color: gold;
            }
    
            .box{
                font-size: 30px;
                width: 300px;
                height: 150px;
                background-color: #fff;
                color: green;
                
                /* 普通元素透明的完整写法,这个写法会带着盒子里的文字一起变透明 */
                opacity: 0.5;  /* 设置透明度 */
                filter: alpha(opacity=30)  /* 为了兼容IE */
            }
            .box2{
                font-size: 30px;
                width: 300px;
                height: 150px;
                margin-top: 50px;
                background-color: rgba(0,0,0,0.3);  /* 这个写法只会让盒子背景变透明,里面的文本不会*/
                color: green;
            }
        </style>
    </head>
    <body>
        <div class="box">这是一个div</div>
        <div class="box2">这是一个div</div>
        
    </body>
    </html>
  • 相关阅读:
    poj3255,poj2449
    poj2186
    poj3249
    poj3378
    poj3274
    poj1948
    hdu 2181暴搜
    hdu 3342
    hdu 1285
    hdu 1598
  • 原文地址:https://www.cnblogs.com/kogmaw/p/12492430.html
Copyright © 2011-2022 走看看