美文网首页
css 毛玻璃实现效果

css 毛玻璃实现效果

作者: 給我小鱼干 | 来源:发表于2019-02-26 14:33 被阅读0次
    <!DOCTYPE html>
    <html lang="en">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <meta http-equiv="X-UA-Compatible" content="ie=edge">
      <title>Document</title>
      <style>
      html, body, div, h1, h2, h3, h4, h5, h6, p, span, img, input {
        margin: 0;
        padding: 0;
    }
    
    html, body {
        font-size: 19px;
        font-family: 'Verdana','Arial';
        color: rgba(0,0,0,0.8);
      width: 100%;
      height: 100%;
    }
    
    .container {
        width: 100%;
        height: 100%;
        position: relative;
        background-image: url('https://darylxyx.github.io/Demo/blur/resource/images/bg1.jpg');
        background-position: center top;
        background-size: cover;
    }
    
    .content {
        width: 800px;
        height: 400px;
        position: absolute;
        top: 50%;
        left: 50%;
        margin-top: -200px;
        margin-left: -400px;
        border-radius: 8px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.5);
        overflow: hidden;
        z-index: 1;
        padding: 50px;
        box-sizing: border-box;
    }
    
    .content::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        -webkit-filter: blur(20px);
        -moz-filter: blur(20px);
        -ms-filter: blur(20px);
        -o-filter: blur(20px);
        filter: blur(20px);
        z-index: -1;
        margin: -30px;
        background-image: url('https://darylxyx.github.io/Demo/blur/resource/images/bg1.jpg');
        background-position: center top;
        background-size: cover;
        background-attachment: fixed;
    }
    
    .content h1 {
        text-align: center;
        margin-bottom: 20px;
    }
    
    .content p {
        line-height: 1.7;
    }
    
    .text {
        position: absolute;
        top: 108px;
        left: 500px;
        z-index: 1;
    }
    
      </style>
    </head>
    <body>
      <div class="container">
            <div class="content">
                <h1>WARFRAME</h1>   
                <p>The Grineer, with their endless clone armies, have plunged the system into chaos. There is only one force that can match them, you.
                You are Tenno, an ancient warrior, a master of gun and blade. You wield the mighty Warframes and command their awesome powers. Forge your weapons. Gather like-minded Tenno and take the fight back to the Grineer. The Origin System needs you once again. Are you ready?</p>  
            </div>
        </div>
    </body>
    </html>
    

    参考《css揭秘》

    相关文章

      网友评论

          本文标题:css 毛玻璃实现效果

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