#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