#section{
position: absolute;
top:0;
height: 100%;
width:100%;
background: url("http://cdn9.howtogeek.com/wp-content/uploads/2010/05/ubuntu-human-1440x900.jpg") no-repeat center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
<body>
<section id="section"></section>
</body>
background-size
时被设定为cover
图像改变其尺寸,当窗口尺寸被改变以覆盖窗口。 有没有办法在开始时完全覆盖background
,然后在更改窗口大小以使图像无响应之后?
我想你可以用JavaScript/jQuery的做到这一点。 – cgee