css - vue 動態(tài)獲取圖片作為背景 想實現背景模糊文字不模糊的效果
問題描述
template> <p v-bind:style='{backgroundImage: ’url(’ + albumpic_big + ’)’}'><!-- {{albumpic_big}}--> <p class='header'> <ul> <li class='icon'> <img src='http://www.gepszalag.com/img/unfold.svg'> </li> <li class='songName'> {{songName}} </li> <li class='icon'> <img src='http://www.gepszalag.com/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.gepszalag.com/img/unfold.svg'> </li> <li class='songName'> {{songName}} </li> <li class='icon'> <img src='http://www.gepszalag.com/img/more.svg'> </li> </ul></p><p>-{{singer}}-</p>讓文字內容獨立出來,再用定位解決怎么樣?回答2:
大神們在哪里><
相關文章:
1. javascript - 求助關于js正則問題2. angular.js - angularjs的自定義過濾器如何給文字加顏色?3. angular.js - 各位大神們,你們混合開發(fā),web方式中更推薦用什么框架呀? react?vue?angular?謝謝~4. javascript - IOS微信audio標簽不能通過touchend播放5. javascript - htaccess rewrite 的問題6. PHP類中的$this7. angular.js使用$resource服務把數據存入mongodb的問題。8. docker-machine添加一個已有的docker主機問題9. 關于docker下的nginx壓力測試10. 為什么我ping不通我的docker容器呢???
