css footer cutting in the sides
I am trying to make an infinite footer to the sides, and even though it's infinite, there is a small margin to the left and right of the footer. I don't have any margins set to my body, html, or anything, so I am unsure on what may be causing this.
Here is my footer css:
#footer {
height: 72px;
width: 100%;
background-color: #174466;
margin: 0 auto;
}
And here开发者_开发百科 is the html:
<div id="footer">
</div>
Any ideas? Thanks!
I don't have any margins set to my body, html
That either means you're not setting it at all, or that you're setting it to 0
.
I'm going to guess that you're not setting it at all, and so you need to zero out the default margin
/padding
on body
/html
.
Try adding this CSS, preferably at the top of your style sheet (for good organization):
html, body {
margin: 0;
padding: 0
}
精彩评论