css - vue 动态获取图片作为背景 想实现背景模糊文字不模糊的效果
问题描述
template> <p v-bind:style='{backgroundImage: ’url(’ + albumpic_big + ’)’}'><!-- {{albumpic_big}}--> <p class='header'> <ul> <li class='icon'> <img src='https://www.haobala.com/img/unfold.svg'> </li> <li class='songName'> {{songName}} </li> <li class='icon'> <img src='https://www.haobala.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='https://www.haobala.com/img/unfold.svg'> </li> <li class='songName'> {{songName}} </li> <li class='icon'> <img src='https://www.haobala.com/img/more.svg'> </li> </ul></p><p>-{{singer}}-</p>让文字内容独立出来,再用定位解决怎么样?回答2:
大神们在哪里><
相关文章:
1. MySQL客户端吃掉了SQL注解?2. 网页爬虫 - python爬虫翻页问题,请问各位大神我这段代码怎样翻页,还有价格要登陆后才能看到,应该怎么解决3. javascript - 图片能在网站显示,但控制台仍旧报错403 (Forbidden)4. mysql - AttributeError: ’module’ object has no attribute ’MatchType’5. 数据库 - MySQL 单表500W+数据,查询超时,如何优化呢?6. android - Windows系统下运行react-native App时,报下面的错误?7. php自学从哪里开始?8. 求大神帮我看看是哪里写错了 感谢细心解答9. phpstady在win10上运行10. objective-c - iOS怎么实现像QQ或者微信的实时推送
