2017-02-09 4 views
-1

У меня проблемы с моим кодом, заполняя только половину экрана. Он заполнит левую половину, но не прав. Я пробовал устанавливать высоту и ширину html до 100%, но это не помогло решить проблему. После этого я также не мог нажать на мои href на другие страницы. Любая помощь будет большой.Первый веб-сайт html занимает только половину страницы

 html { 
 
     \t margin: 0; 
 
     \t height: 100%; 
 
     \t width: 100%; 
 
     } 
 
     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; 
 
     } 
 
     
 
     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> 
 
     <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>

+0

привет @dillan вы можете вставить HTML код пожалуйста –

ответ

0

Добавьте свой код в основном DIV и добавить ширину шириной margin: 0 auto

.mainContainer{ 
    width:990px; 
    margin: 0 auto; 
} 
+0

Это центрируется моя страница, но это по-прежнему не охватывает всю страницу. Спасибо, что ответили. –

Смежные вопросы