我正在試圖製作目前寬度爲1500px左右寬度的橫幅圖片,我已將其設置爲背景圖片,以便我可以在toptop上播放一些元素,我知道你可以製作一個圖片標籤全寬,但我不確定你是否可以對背景圖片標籤做同樣的事情!爲所有瀏覽器製作圖片全寬(bg)
這是我的代碼;
<div id="bannerbg">
<div class="container">
<p id="bannertxt">demo text</p>
</div>
</div>
.container{
width:980px;
margin:0px auto;
}
#bannerbg{
background-image:url('../images/banner.png');
width:1520px;
height:369px;
background-repeat: no-repeat;
margin:0px auto;
position: absolute;
}
#bannertxt{
background:rgba(0,0,0,0.5);
font-size:26px;
font-family: 'Roboto Condensed', sans-serif;
width:300px;
color:white;
}
.bannertxt{
padding-top:40px;
}
http://stackoverflow.com/questions/16705367/creating-a-full-width-image/16706285#16706285請在這裏看到答案 – Joe 2013-05-23 05:36:56