1000字范文,内容丰富有趣,学习的好帮手!
1000字范文 > css设置背景图片模糊 内容不模糊

css设置背景图片模糊 内容不模糊

时间:2022-10-08 18:20:18

相关推荐

css设置背景图片模糊 内容不模糊

每日编程|css知识

css 背景模糊

每日编程-css知识

需求:一个p设置了background: url,现在需要使图片背景模糊,p内的文字清晰显示。

网络公司企业网站源码,ubuntu 设置头文件,服务部署访问tomcat,爬虫大战电,php网站邮箱注册示例,SEO售前lzw

原始代码:

五大神兽H5源码,ubuntu安装厨房工具,nodejs爬虫框架推荐,php 返回索引,seo年龄优化lzw

.content { color: #ffffff; font-size: 40px; } .bg { background: url(1.jpg); background-repeat: no-repeat; background-position: center; background-size: cover; height:600px; text-align: center; line-height: 600px; }

我是内容

糗事百科客户端服务器全套源码,vscode连接服务器文件,ubuntu web发布,jdk和Tomcat冲突,python 爬虫接口,php 2047,seo与竞价排名的案例,网站flash横幅lzw

原始效果:

解决方法:内容和图片分别置于一个p,通过css设置背景p模糊度,设置内容p绝对位置。

html代码:

.content { color: #ffffff; font-size: 40px; } .bg { background: url(1.jpg); height:600px; text-align: center; line-height: 600px; } .bg-blur { float: left; width: 100%; background-repeat: no-repeat; background-position: center; background-size: cover; -webkit-filter: blur(15px); -moz-filter: blur(15px); -o-filter: blur(15px); -ms-filter: blur(15px); filter: blur(15px); } .content-front {position:absolute;left: 10px;right: 10px;height:600px;line-height: 600px;text-align: center; }

我是内容

效果:

需求:一个p设置了background: url,现在需要使图片背景模糊,p内的文字清晰显示。

原始代码:

.content { color: #ffffff; font-size: 40px; } .bg { background: url(1.jpg); background-repeat: no-repeat; background-position: center; background-size: cover; height:600px; text-align: center; line-height: 600px; }

我是内容

原始效果:

解决方法:内容和图片分别置于一个p,通过css设置背景p模糊度,设置内容p绝对位置。

html代码:

.content { color: #ffffff; font-size: 40px; } .bg { background: url(1.jpg); height:600px; text-align: center; line-height: 600px; } .bg-blur { float: left; width: 100%; background-repeat: no-repeat; background-position: center; background-size: cover; -webkit-filter: blur(15px); -moz-filter: blur(15px); -o-filter: blur(15px); -ms-filter: blur(15px); filter: blur(15px); } .content-front {position:absolute;left: 10px;right: 10px;height:600px;line-height: 600px;text-align: center; }

我是内容

效果:

感谢大家的阅读,希望大家受益良多。

本文转自:/oHeHeHou/article/details/51975539

推荐教学:《css教学》

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。