[英]Eliminating white space at bottom of page
最初我有一個背景圖像顯示為漸變背景。 想要有一個純黑色背景,我刪除了指向背景圖像/重復 x 的鏈接。 結果是頁面底部有一個大的空白區域。 我已經搜索了很多這個常見問題的答案,但沒有一個能幫助我解決這個問題。
這是一個 .php 站點,所以如果有一個 html .div 那么我找不到它,但在 css 樣式表中它只是讀取為 #top-bg with background: #000000
我試過增加高度:100%; 不確定在某些網站推薦的哪里調整邊距。 任何幫助將不勝感激!
body, html{
padding:0!important;
margin:0 !important;
background:#000;//is this what you want?
}
首先,您是否考慮刪除默認瀏覽器填充和邊距?
html{
margin: 0;
padding: 0;
}
另外,在哪里定義你的背景?
更好的是,背景是在你的身體標簽中定義的:
body{
background-color: #FCC; /* for test */
}
如果您沒有填充,沒有邊距,則此代碼適合您...
試試這個
body, html {
background:#000;
height:100%;
padding:0;
margin:0
}
html {
background:#000;
}
這足以讓我刪除空白。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.