简体   繁体   中英

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

I'm trying to create a footer for my website but this ugly left side white space keeps appearing, I've already tried things such as overflow-x: hidden , margin: 0 and padding: 0 .

Here is the footer I'm trying to create as you can see the left side has space while the right doesn't

在此处输入图像描述

 #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>

Add left: 0 to the footer as well

 #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>

add this to your styles

body {
    margin: 0;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM