2016-10-20 154 views
2

所以我正在爲一個朋友編寫一個藝術網站雜誌,而我的代碼的一部分並沒有擺脫我擔心的一些邊距/填充,可能是主體網站編碼的一部分,所以這將是我需要手動覆蓋的東西。 This is what I am working on.該日誌皮膚。朝向底部的岩石應該與期刊的邊緣齊平,但無論我嘗試什麼,他們都不會做我想要的。擺脫利潤率?

這是編碼我有這麼遠,這是不是有很多:

<div class="body"> 
    <div class="header"></div> 
     <div class="contentholder"></div><div class="rockfooter"></div> 
</div> 

除了:

.gr-body { 
background: url(http://orig14.deviantart.net/8b57/f/2016/279/f/5/frontpagebackground_by_wulfghast-dak5apt.jpg); 
background-size: 100%; 
background-repeat: no-repeat; 
background-color: #1c1119; 
color: #545454; } 

.header { 
background-image: url(http://s10.postimg.org/bvl7xjjbd/branchborder.png); 
background-position: top center; 
background-repeat: no-repeat; 
background-size: contain; 
margin-left: auto; 
margin-right: auto; 
margin-top: 20%; 
position: relative; 
z-index: 2; 
height: 873px; 
width: 74%; 
display: block; } 

.contentholder { 
width: 68%; 
margin-left: auto; 
margin-right: auto; 
margin-top: -800px; 
-moz-box-shadow: 0 0 20px 5px #0a0a0a; 
-webkit-box-shadow: 0 0 20px 5px #0a0a0a; 
box-shadow: 0 0 20px 5px #0a0a0a; 
background-color: #50463b; 
position: relative; 
z-index: 1; 
display: block; } 

.rockfooter { 
background: url(http://s17.postimg.org/is79jxd3z/footer3_by_wulfghast_dakd92b_1.png); 
height: 1000px; 
width: 100%; 
background-position: bottom; 
background-repeat: no-repeat; 
background-size: contain; 
margin-left: auto; 
margin-right: auto; 
margin-top: -985px; 
position: relative; 
z-index: 4; } 

.bottom { 
display: none; } 

回答

0

可以重置一般定義有:

* { 
    box-sizing: border-box; 
    margin: 0; 
    vertical-align: baseline; 
} 
1

在您分享的特定頁面上,您的搖滾樂

<div class=body> 

是內部的

<div class=text> 

具有圍繞它的填充。

看看你不能擺脫那個填充,它會使它與兩側齊平。

+0

這是真的......您可能想要添加解決方案「.text {padding:0px;}」您的答案爲OP試試 – repzero

+0

看起來像那樣工作!我甚至從來沒有想過通過我的瀏覽器來檢查它。謝謝! –

+0

沒問題!永遠記得通過瀏覽器首先檢查,你會經常發現一些奇怪的事情,你沒有想到! – Nol