求助!html在里面添加背景图片代码,显示模糊,怎么搞?

求助!html在里面添加背景图片代码,显示模糊,怎么搞?如图

第1个回答  2018-06-24

HTML 中要设置背景的块大小  比如div    300px * 400px

那么背景图的最佳尺寸也是 300px 400px 

然后设置 background: url(imgs/your.jpg)  no-repeat  center center; 

背景水平垂直居中,效果最佳

css样式background属性值详解

背景图无论是缩放还是扩展,都会失真变得模糊,所以尺寸最接近块的大小最好

本回答被网友采纳
第2个回答  2018-06-23

加一个半透明遮罩

.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;

}

转自csdn: 网页链接,注意要孤立背景的div

追问

怎么加

追答

就把背景的diiv的class="上面的css标签"

相似回答