每日编程|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教学》