亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

通過CSS模糊沒有背景圖像的元素

通過CSS模糊沒有背景圖像的元素

狐的傳說 2023-10-17 17:01:03
使用background-imageonbody標簽和div其中的two 。我需要為每個都有模糊的背景 div。我現在能做的就是對background-image每個進行設置div并使用filter: blur屬性來模糊它們。但因為我希望整個頁面具有相同的背景(不為每個頁面分開div),所以我希望它的方式是在標簽background-image 上設置body,然后模糊div元素。這就是我嘗試過的:body {    background-image: url(public/images/billy-huynh-W8KTS-mhFUE-unsplash\ \(1\).jpg);    background-attachment: fixed;    background-size: cover;    display: grid;    align-items: center;    justify-content: center;    height: 100vh;    width: 100vw;    position: relative;}.parent-div::before {    content: "";    display: block;    position: absolute;    top: 0;    bottom: 0;    right: 0;    left: 0;    width: 100%;    height: 100%;    filter: blur(5px);}.parent-div {    position: relative;}HTML 代碼:<body><div class=" parent-div">    <div class=" child-div">        <h4 class=" text-light">Hello world!!</h4>    </div></div><div class=" parent-div">    <div class=" child-div">        <h4 class=" text-light">Hello world!!</h4>    </div></div>事實上,我想模糊div沒有背景圖像的元素。有辦法這樣做嗎?謝謝
查看完整描述

目前暫無任何回答

  • 0 回答
  • 0 關注
  • 130 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號