在一个<div>里只设置background: url(""),背景图片没有宽高是无法显示的,如果div里有内容了,会随内容而扩展,如何使背景图片铺满整个浏览器视口?
.container{
width: 100%;
height: 100%;
position: absolute;
overflow: hidden;
background: url("") no-repeat;
}
在一个<div>里只设置background: url(""),背景图片没有宽高是无法显示的,如果div里有内容了,会随内容而扩展,如何使背景图片铺满整个浏览器视口?
.container{
width: 100%;
height: 100%;
position: absolute;
overflow: hidden;
background: url("") no-repeat;
}