2013-08-06 58 views
0

所以即時工作的項目工作。底部的長黑色容器不會跨越頁面的整個寬度。它在任一側都會縮短几個像素。這裏是我的代碼:在一個div中的圖像沒有跨越整個頁面的寬度

http://74.117.156.152/~pr0digy/ 

<header class="mainHeader"> 
     <img src="images/uslegalbox.png" alt="usls box" > 
    </header> 

    <div class="textBox"> 

      <article class="capexText"> 
       <h2>Capital</h2><br /> 
       <h2>Expenditures</h2> 
      </article>   

     <div class="buttonsBox"> 
      <nav><ul> 
       <li><a href="#" >New CapEx</li> 
       <li><a href="#" >Check Status</li> 
      </ul></nav> 
     </div> 

    </div> 

,並與它一起去的CSS:

body { 
     background: url('images/bg.jpg'); 
     background-size: 100%; 
     background-repeat:no-repeat; 
     color: #000305; 
     font-size: 87.5%; /* Base font size is 14px */ 
     font-family: Arial; 'Lucida Sans Unicode'; 
     line-height: 1.2; 
     text-align: left; 
     width: 100%;  
} 

.mainHeader { 
     width: 30% 
     height: auto; 
     margin: 2% 0 0 -1%; 
} 

.mainHeader img { 
     width: 35%; 
     height: auto; 
} 

.textBox { 
     margin-top: 10%; 
     height: 275px; 
     background-image: url('images/buttonsbox.png'); 
     background-repeat: repeat-x; 


} 

我敢肯定,我只是失蹤一些簡單的東西,所以任何幫助讚賞。謝謝!

+0

'體{保證金:0}' –

回答

0

如果添加 margin:0; padding:0; 的車身造型將默認margin和padding重置爲0。

0

確保您使用像Eric MeyersNormalize.css這樣的重置樣式表,因此將所有元素樣式設置爲默認樣式。 (清除體內/ HTML填充等)

相關問題