css - vue 動態獲取圖片作為背景 想實現背景模糊文字不模糊的效果
問題描述
template> <p v-bind:style='{backgroundImage: ’url(’ + albumpic_big + ’)’}'><!-- {{albumpic_big}}--> <p class='header'> <ul> <li class='icon'> <img src='http://www.4tl426be.cn/img/unfold.svg'> </li> <li class='songName'> {{songName}} </li> <li class='icon'> <img src='http://www.4tl426be.cn/img/more.svg'> </li> </ul></p><p>-{{singer}}-</p> </p></template> #playPage{width: 100%;height: 100%;position: relative; } #playPage.blur{position: absolute;top: 0;left: 0;background-size:cover;filter: blur(8px) } #playPage:before{content: ’’;position: absolute;width: 100%;height: 100%;top: 0;left: 0;bottom: 0;right: 0;filter: blur(7px);z-index: -1; }
之前這樣我都是直接寫偽元素 設置背景圖是在偽元素上 但是因為綁定的數據不能寫在css中 所以不知道怎么辦
問題解答
回答1:<p v-bind:style='{backgroundImage: ’url(’ + albumpic_big + ’)’}'></p><p class='header'> <ul> <li class='icon'> <img src='http://www.4tl426be.cn/img/unfold.svg'> </li> <li class='songName'> {{songName}} </li> <li class='icon'> <img src='http://www.4tl426be.cn/img/more.svg'> </li> </ul></p><p>-{{singer}}-</p>讓文字內容獨立出來,再用定位解決怎么樣?回答2:
大神們在哪里><
相關文章:
1. docker - 各位電腦上有多少個容器???容器一多,自己都搞混了,咋辦呢?2. java - spring boot 如何打包成asp.net core 那種獨立應用?3. java - 在用戶不登錄的情況下,用戶如何添加保存到購物車?4. datetime - Python如何獲取當前時間5. javascript - nginx反向代理靜態資源403錯誤?6. docker網絡端口映射,沒有方便點的操作方法么?7. 安全性測試 - nodejs中如何防mySQL注入8. javascript - 關于apply()與call()的問題9. docker start -a dockername 老是卡住,什么情況?10. python - 調用api輸出頁面,會有標簽出現,請問如何清掉?
