Skip to content Skip to sidebar Skip to footer

Fixed Position Footer At 100% Width Extends Past Window To Right

I need help with trying to get this footer set in a fixed position. I'm learning as I go and trying to make a reasonably liquid layout. It's a work-in-progress but I can't continue

Solution 1:

You could do it by set margin:0px; to body and box-sizing: border-box; to footer

JSFiddle - DEMO

body {
    text-align: center;
    background-color: #1A1A1A;
    background-image: url('#');
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
    margin:0px;
}
#footer {
    background-color: rgba(53, 53, 53, 0.9);
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 22px;
    padding: 3px;
    color: #FFF;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

Solution 2:

Here's whats wrong:

#footer {
   width: 100%;
   padding: 3px;
}

Your footer width is set to 100% + 6px from padding.

Try adding this to make padding (and border) part of footer content:

#footer{
   box-sizing: border-box;
}

Solution 3:

try this:

<div id="footer">Hello there!</div>

Post a Comment for "Fixed Position Footer At 100% Width Extends Past Window To Right"