[英]How to make header go right across the page?
我想將標題擴展到整個頁面,查看下面的圖片:
http://gyazo.com/61982a6809817c30f882808ff55972ca.png
我原本計划將橫幅廣告包裝在包裝紙中,但是現在我改變了主意,希望它可以在頁面上顯示。 我不確定要實現此目的必須輸入什么代碼。 以下是我的HTML和CSS。
(我知道橫幅的質量會受到影響,但現在我不必擔心)
HTML:
<body>
<div id="wrapper">
<div id="banner">
<a href="index.html"><img src="images/banner/banner2.png" width="1000"></a>
</div>
CSS:
body {
background-image:url(../images/background/fifa14.jpg);
background-repeat:no-repeat;
background-attachment:fixed;
}
#wrapper {
width:1000px;
margin:0 auto;
background-color:#FFF
}
非常感謝你!
您需要從包裝紙上取下橫幅並將其寬度設置為100%:
將您的HTML更改為:
<body>
<div id="banner">
<a href="index.html"><img src="images/banner/banner2.png" width="1000"></a>
</div>
<div id="wrapper">
將此添加到您的CSS:
#banner img {width:100%}
嘗試將#wrapper寬度設置為100%,是否意味着要將圖像設置為全屏十字形?
以及圖像寬度。
感謝希望,如果有幫助。
這里是一個例子, 點擊這里
HTML
<body>
<div id="wrapper">
<a href="index.html">
<div id="banner"></div>
</a>
</div>
</body>
CSS
body{background-color:slategray;margin:0;}
#banner{
background: red;
width:100%;
height:100px;
border-bottom:2px solid gold;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.