簡體   English   中英

如何刪除 div 左側的空白間距?

[英]How can I remove the empty spacing on the left side of my div?

我正在嘗試為我的網站創建一個頁腳,但這個丑陋的左側空白不斷出現,我已經嘗試過諸如overflow-x: hiddenmargin: 0padding: 0之類的東西。

這是我要創建的頁腳,因為您可以看到左側有空間而右側沒有

在此處輸入圖像描述

 #footer{ /* border: 2px dashed #f69c55;*/ display: table; position: fixed; bottom: 0; width: 100%; height: 50px; line-height: 50px; background-color: black; float: left; } #footer a{ margin-left: 50px; vertical-align: middle; color: whitesmoke; }
 <div id="footer"> <a>Number: 0000000</a> <a>fax: bruh moment</a> <a>email: smidgin@gmail.com</a> <div>

也將left: 0添加到頁腳

 #footer{ /* border: 2px dashed #f69c55;*/ display: table; position: fixed; left:0; bottom: 0; width: 100%; height: 50px; line-height: 50px; background-color: black; float: left; } #footer a{ margin-left: 50px; vertical-align: middle; color: whitesmoke; }
 <div id="footer"> <a>Number: 0000000</a> <a>fax: bruh moment</a> <a>email: smidgin@gmail.com</a> <div>

將此添加到您的 styles

body {
    margin: 0;
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM