国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > CSS > 正文

CSS3打造磨砂玻璃背景效果

2024-07-11 08:32:28
字體:
來源:轉載
供稿:網友

簡介

這個效果是在看CSS Secrets這書上看到的,感覺很不錯;

實現原理也挺簡單的;

效果圖及實現

效果圖

代碼實現

CSS Code復制內容到剪貼板
  1. <!DOCTYPE html>    <html lang="en">   
  2.     <head>            <meta charset="UTF-8">   
  3.         <title>Document</title>            <style>   
  4.                     /**                        * 設置背景圖全屏覆蓋及固定  
  5.                      * 設置內部元素偏移                        */  
  6.                     body {                            /*此處背景圖自行替換*/  
  7.                         background: url(demo.jpg) no-repeat center center fixed;                            background-size: cover;   
  8.                          min-height: 100vh;                            box-sizing: border-box;   
  9.                         margin: 0;                            padding-top: calc(50vh - 6em);   
  10.                         font: 150%/1.6 Baskerville, Palatino, serif;                        }   
  11.                        /**  
  12.                      * 整體居中功能;                        * 背景透明虛化  
  13.                      * 溢出隱藏                        * 邊緣圓角化  
  14.                      * 文字增加淡陰影                        */  
  15.                     .description{                            position: relative;   
  16.                         margin: 0 auto;                            padding: 1em;   
  17.                         max-width: 23em;                            background: hsla(0,0%,100%,.25) border-box;   
  18.                         overflow: hidden;                            border-radius: .3em;   
  19.                         box-shadow: 0 0 0 1px hsla(0,0%,100%,.3) inset,                                        0 .5em 1em rgba(0, 0, 0, 0.6);   
  20.                         text-shadow: 0 1px 1px hsla(0,0%,100%,.3);                        }   
  21.                        /*使用濾鏡模糊邊緣*/  
  22.                     .description::before{                            content: '';   
  23.                         position: absolute;                            top: 0; rightright: 0; bottombottom: 0; left: 0;   
  24.                         margin: -30px;                            z-index: -1;   
  25.                         -webkit-filter: blur(20px);                            filter: blur(20px);   
  26.                     }            </style>   
  27.     </head>        <body>   
  28.         <p class="description">            Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod   
  29.         tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,            quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo   
  30.         consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse            cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non   
  31.         proident, sunt in culpa qui officia deserunt mollit anim id est laborum.            </p>   
  32.     </body>    </html>   
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 舒城县| 镇赉县| 江门市| 米林县| 溧水县| 洞口县| 元江| 高要市| 永泰县| 龙口市| 稷山县| 泰宁县| 阜新市| 贵州省| 兴城市| 乌兰浩特市| 宜兴市| 平昌县| 黄浦区| 德钦县| 哈尔滨市| 民勤县| 德安县| 汨罗市| 双流县| 衡阳县| 宁德市| 鹤壁市| 介休市| 荆门市| 洪雅县| 斗六市| 佛教| 门源| 尖扎县| 闵行区| 新闻| 宜州市| 汝南县| 登封市| 辉县市|