我的標題基本上是這麼說的。出於某種原因,我無法讓它伸展整個頁面。我對此很陌生,所以任何幫助都會很棒。css填充整個頁面時出現問題
這是我的代碼的HTML。我被告知,寬度和邊距需要從一個朋友改變,我嘗試這樣做,但得到了相同的結果。
.maincontainer{
\t width: 990px;
\t margin: 0 auto;
}
body {
\t background: #B2906F;
\t font-family: arial;
\t margin: 0;
\t height: 100%;
}
.picture{
\t display: inline;
\t margin: 0;
\t padding: 0;
\t position: fixed;
\t z-index: -1;
\t background-size: 100%
}
.button{
\t padding: 10px 15px;
\t text-decoration: none;
\t border-radius: 5px;
\t background-color: #05280c
}
.button-primary:hover {
\t background-color: #05370c
}
h1 \t {
\t display: inline;
\t margin: 0;
\t background-color: #2c421f;
\t padding: 5px;
\t position: absolute;
}
ul{
\t margin: 0;
\t display: inline;
\t padding: 0px 0px 0px 250px;
}
ul li {
\t display: inline-block;
\t list-style-type: none;
\t padding: 15px 10px;
\t color: #050c0c;
\t margin: 0;
\t border-radius: 5px;
}
ul li a {
\t color: black;
}
footer{
\t clear: both;
}
nav {
\t color:
\t height: 40px;
\t margin: 0;
\t background-color: #2c421f;
}
<!doctype html>
<div class="maincontainer">
<html>
\t <head>
\t \t <title>NWWolfPack</title>
\t \t <link href="main.css" rel="stylesheet" />
\t </head>
\t
\t <body>
\t \t <h1>NW Wolf Pack</h1>
\t \t <div class="picture"><img src="camo.jpg" width="1000" height="150">
\t <header> \t
\t \t \t <nav>
\t \t \t \t <ul>
\t \t \t \t \t <li class="button"><strong>Home</strong></li>
\t \t \t \t \t <li><a href="records.html" class="button button-primary"><strong>Records</strong></a></li>
\t \t \t \t \t <li><a href="membership.html" class="button button-primary"><strong>Membership</strong></a></li>
\t \t \t \t \t <li><a href="contactus.html" class="button button-primary"><strong>Contact Us</strong></a></li>
\t \t \t \t </ul>
\t \t \t </nav>
\t \t </header>
\t </body>
\t
\t
\t <footer>2017 Dillan Hall</footer>
</html>
''div class =「maincontainer」>'應該在'
'之後。 ''是最外面的標籤。 html只能包含頭部和身體。 ''div class =「maincontainer」>''width:990px;',所以頁面不會超過990px。 – Banzay