Why does my footer have bottom white space and non-sticky?

I’m trying to get my footer to stick to the bottom but it does not want too and there’s also whitespace below the footer…? Please take a look at the code below. Thanks.

<html>
  <head>
    <meta name="generator"
    content="HTML Tidy for HTML5 (experimental) for Windows https://github.com/w3c/tidy-html5/tree/c63cc39" />
    <title>Demo SITE001</title>
    <link rel="stylesheet" type="text/css" href="site001.css" />
  </head>
  <body>
    <div id="wrap">
      <header>
        <h1>Company Name</h1>
        <p>&quot;tagline goes here.&quot;</p>
      </header>
      <div id="content">
        <p id="featured">Porta nec dignissim et egestas hac a lacus, risus in, urna vel. Enim in odio sed cum odio sed pellentesque
        facilisis in adipiscing et, pulvinar lorem placerat lacus, lacus, nascetur facilisis scelerisque. In magna integer integer
        a porttitor in duis, non facilisis, velit nec sagittis integer enim nec! Nisi magnis dictumst mid magna, est? Vel ut duis
        mid scelerisque urna, rhoncus phasellus, nisi. Aenean. Tristique natoque tempor nec, ultricies vut, amet ultricies nec
        scelerisque, nunc, elit! Tempor, diam augue magna nisi ut turpis phasellus, odio, placerat sociis nisi est sit mattis
        placerat turpis eu eros nunc, adipiscing. Elementum? Lundium? Rhoncus.</p>
        <div id="categorywrap">
          <p class="category">
          <span class="categorytitle">Category1</span>Diam urna sociis, vut! Urna enim, ut, nunc tincidunt facilisis.</p>
          <p class="category">
          <span class="categorytitle">Category2</span>Eu? Magna amet cursus magna? Turpis auctor enim odio tortor.</p>
          <p class="category">
          <span class="categorytitle">Category3</span>Scelerisque aliquet odio? Et tempor, ridiculus vel hac tortor, turpis.</p>
          <p class="category">
          <span class="categorytitle">Category1</span>Diam urna sociis, vut! Urna enim, ut, nunc tincidunt facilisis.</p>
          <p class="category">
          <span class="categorytitle">Category2</span>Eu? Magna amet cursus magna? Turpis auctor enim odio tortor.</p>
          <p class="category">
          <span class="categorytitle">Category3</span>Scelerisque aliquet odio? Et tempor, ridiculus vel hac tortor, turpis.</p>
          <p class="category">
          <span class="categorytitle">Category1</span>Diam urna sociis, vut! Urna enim, ut, nunc tincidunt facilisis.</p>
          <p class="category">
          <span class="categorytitle">Category2</span>Eu? Magna amet cursus magna? Turpis auctor enim odio tortor.</p>
          <p class="category">
          <span class="categorytitle">Category3</span>Scelerisque aliquet odio? Et tempor, ridiculus vel hac tortor, turpis.</p>
          <p class="category">
          <span class="categorytitle">Category1</span>Diam urna sociis, vut! Urna enim, ut, nunc tincidunt facilisis.</p>
          <p class="category">
          <span class="categorytitle">Category2</span>Eu? Magna amet cursus magna? Turpis auctor enim odio tortor.</p>
          <p class="category">
          <span class="categorytitle">Category3</span>Scelerisque aliquet odio? Et tempor, ridiculus vel hac tortor, turpis.</p>
        </div>
      </div>
      <nav>
        <ul>
          <li>Link1</li>
          <li>Link2</li>
          <li>Link3</li>
        </ul>
      </nav>
      <div class="clearfix"></div>
      <div class="push"></div>
    </div>
    <footer>Copyright © 2013. GCStudio. All Rights Reserved.</footer>
  </body>
</html>

* {
    margin: 0;
}
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var,
b, i,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, figcaption, figure,
footer, header, hgroup, menu, nav, section, summary,
time, mark, audio, video {
    margin:0;
    padding:0;
    border:0;
    outline:0;
    font-size:100%;
    vertical-align:baseline;
    background:transparent;
}
body {
    line-height:1;
}
article,aside,details,figcaption,figure,
footer,header,hgroup,menu,nav,section {
    display:block;
}
nav ul {
    list-style:none;
}
blockquote, q {
    quotes:none;
}
blockquote:before, blockquote:after,
q:before, q:after {
    content:'';
    content:none;
}
a {
    margin:0;
    padding:0;
    font-size:100%;
    vertical-align:baseline;
    background:transparent;
}
/* change colours to suit your needs */
ins {
    background-color:#ff9;
    color:#000;
    text-decoration:none;
}
/* change colours to suit your needs */
mark {
    background-color:#ff9;
    color:#000;
    font-style:italic;
    font-weight:bold;
}
del {
    text-decoration: line-through;
}
abbr[title], dfn[title] {
    border-bottom:1px dotted;
    cursor:help;
}
table {
    border-collapse:collapse;
    border-spacing:0;
}
/* change border colour to suit your needs */
hr {
    display:block;
    height:1px;
    border:0;
    border-top:1px solid #cccccc;
    margin:1em 0;
    padding:0;
}
input, select {
    vertical-align:middle;
}

/* SITE001.CSS STYLESHEET */
body {
    height: 100%;
    margin: 0 auto;
    text-align: center;
    width: 420px;
}
#wrap {
    text-align: left;
    padding-top: 25px;
    border-left: 1px solid red;
    border-right: 1px solid red;
    height: auto !important;
    height: 100%; /* IE 6 Workaround */
    min-height: 100%;
}
header {
    margin-bottom: 25px;
    padding-bottom: 3px;
    border-bottom: 2px solid whitesmoke;
}
header h1,header p {
    text-align: center;
}
#content {
    float: right;
    width: 300px;
}
#categorywrap {
    width: 300px;
    text-align: center;
}
.category {
    float: left;
    width: 80px;
    padding: 10px;
}
.categorytitle {
    display: inline-block;
    font-weight: bold;
}
nav {
    float: left;
    width: 75px;
}
nav ul li {
    margin-bottom: 2px;
    border-bottom: 1px dashed red;
    border-left: 5px solid blue;
    padding-bottom: 5px;
}
footer {
    position: absolute;
    text-align: center;
    height: 25px;
    bottom: 0;
}
.clearfix { clear: both; }
.push { height: 25px; }

CSS wasn’t really designed for sticky footers, but a bulletproof method has been worked out, though you have to be careful to get it right. Here are instructions for how to do it:

Work your way through that guide and let us know how you go. :slight_smile:

I got it working without any extra negative space below or above the footer. But one thing that bothers me is how did I remove the negative space? I followed the guide in your link and did most of everything but I didn’t have to apply a negative margin on the bottom or top and it still works. Here’s my code if you can let me know what I did made it work… it will be helpful in the future to know.


<html>
  <head>
    <title>Demo SITE001</title>
    <link rel="stylesheet" type="text/css" href="site001.css" />
  </head>
  <body>
    <div id="wrap">
      <header>
        <h1>Artista Notícies</h1>
        <p>&quot;Trencar la barrera de la tècnica&quot;</p>
      </header>
      <div id="content">
        <p id="featured">Porta nec dignissim et egestas hac a lacus, risus in, urna vel. Enim in odio sed cum odio sed pellentesque
        facilisis in adipiscing et, pulvinar lorem placerat lacus, lacus, nascetur facilisis scelerisque. In magna integer integer
        a porttitor in duis, non facilisis, velit nec sagittis integer enim nec! Nisi magnis dictumst mid magna, est? Vel ut duis
        mid scelerisque urna, rhoncus phasellus, nisi. Aenean. Tristique natoque tempor nec, ultricies vut, amet ultricies nec
        scelerisque, nunc, elit! Tempor, diam augue magna nisi ut turpis phasellus, odio, placerat sociis nisi est sit mattis
        placerat turpis eu eros nunc, adipiscing. Elementum? Lundium? Rhoncus.</p>
      </div><!-- END CONTENT -->
      <nav>
        <ul>
          <li>Link1</li>
          <li>Link2</li>
          <li>Link3</li>
        </ul>
        <p id="watermark">©</p>
      </nav><!-- END NAV -->
      <div class="clearfix"></div>
        <div id="categorywrap">
          <p class="category">
          <span class="categorytitle">Category1</span>Diam urna sociis, vut! Urna enim, ut, nunc tincidunt facilisis.</p>
          <p class="category">
          <span class="categorytitle">Category2</span>Eu? Magna amet cursus magna? Turpis auctor enim odio tortor.</p>
          <p class="category">
          <span class="categorytitle">Category3</span>Scelerisque aliquet odio? Et tempor, ridiculus vel hac tortor, turpis.</p>
          <p class="category">
          <span class="categorytitle">Category4</span>Diam urna sociis, vut! Urna enim, ut, nunc tincidunt facilisis.</p>
          <div class="clearfix"></div><!-- END CLEARFIX -->

          <p class="category">
          <span class="categorytitle">Category1</span>Eu? Magna amet cursus magna? Turpis auctor enim odio tortor.</p>
          <p class="category">
          <span class="categorytitle">Category2</span>Scelerisque aliquet odio? Et tempor, ridiculus vel hac tortor, turpis.</p>
          <p class="category">
          <span class="categorytitle">Category3</span>Diam urna sociis, vut! Urna enim, ut, nunc tincidunt facilisis.</p>
          <p class="category">
          <span class="categorytitle">Category4</span>Eu? Magna amet cursus magna? Turpis auctor enim odio tortor.</p>
          <div class="clearfix"></div><!-- END CLEARFIX -->

          <p class="category">
          <span class="categorytitle">Category1</span>Scelerisque aliquet odio? Et tempor, ridiculus vel hac tortor, turpis.</p>
          <p class="category">
          <span class="categorytitle">Category2</span>Diam urna sociis, vut! Urna enim, ut, nunc tincidunt facilisis.</p>
          <p class="category">
          <span class="categorytitle">Category3</span>Eu? Magna amet cursus magna? Turpis auctor enim odio tortor.</p>
          <p class="category">
          <span class="categorytitle">Category4</span>Scelerisque aliquet odio? Et tempor, ridiculus vel hac tortor, turpis.</p>
        </div><!-- END CATEGORYWRAP -->
      <div class="push"></div>
    </div><!-- END WRAP -->
    <footer>
        Copyright &copy; 2013. Company. All Rights Reserved.
    </footer>
  </body>
</html>


* {
    margin: 0;
}
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var,
b, i,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, figcaption, figure,
footer, header, hgroup, menu, nav, section, summary,
time, mark, audio, video {
    margin:0;
    padding:0;
    border:0;
    outline:0;
    font-size:100%;
    vertical-align:baseline;
    background:transparent;
}
body {
    line-height:1;
}
article,aside,details,figcaption,figure,
footer,header,hgroup,menu,nav,section {
    display:block;
}
nav ul {
    list-style:none;
}
blockquote, q {
    quotes:none;
}
blockquote:before, blockquote:after,
q:before, q:after {
    content:'';
    content:none;
}
a {
    margin:0;
    padding:0;
    font-size:100%;
    vertical-align:baseline;
    background:transparent;
}
/* change colours to suit your needs */
ins {
    background-color:#ff9;
    color:#000;
    text-decoration:none;
}
/* change colours to suit your needs */
mark {
    background-color:#ff9;
    color:#000;
    font-style:italic;
    font-weight:bold;
}
del {
    text-decoration: line-through;
}
abbr[title], dfn[title] {
    border-bottom:1px dotted;
    cursor:help;
}
table {
    border-collapse:collapse;
    border-spacing:0;
}
/* change border colour to suit your needs */
hr {
    display:block;
    height:1px;
    border:0;
    border-top:1px solid #cccccc;
    margin:1em 0;
    padding:0;
}
input, select {
    vertical-align:middle;
}

/* SITE001.CSS STYLESHEET */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}
body {
    height: 100%;
    margin: 0 auto;
    text-align: center;
    width: 420px;
}
#wrap {
    text-align: left;
    padding-top: 25px;
    border-left: 2px solid whitesmoke;
    border-right: 2px solid whitesmoke;
    min-height: 100%;
    overflow: hidden;
}
* html #outer {
    height: 100%;
}
header {
    margin-bottom: 25px;
    padding-bottom: 3px;
    border-bottom: 2px solid #00A1D9;
    font-family: Georgia, helvetica, sans-serif;
}
header h1 { font-size: 24px; }
header p { font-size: 18px; }
header h1,header p {
    text-align: center;
}
#content {
    float: right;
    width: 300px;
    padding: 0 10px 25px 0;
    font-size: 14pt;
    line-height: 16pt;
    z-index: 9999;
}
#categorywrap {
    width: 410px;
    text-align: center;
    padding: 5px 0 0 10px;
    border-top: 2px solid #F5DABD;
}
.category {
    float: left;
    width: 80px;
    padding: 10px;
    text-align: left;

}
.category:hover {
    background-color: #90d1ff;
    cursor: pointer;
    font-size: 10pt;
}
.categorytitle {
    display: inline-block;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid #F5DABD;
    font-family: Georgia;
}
nav {
    float: left;
    width: 75px;
}
nav ul {
    height: 80px;
    overflow: visible;
}
nav ul li {
    margin-bottom: 2px;
    border-bottom: 2px solid #00a1d9;
    padding: 5px 0 3px 10px;
    background-color: #ededed;
}
nav ul li:hover { margin-bottom: 25px; width:85px;}
nav p {
    position: relative;
    font-size: 256px;
    color: #f0f0f0;
    z-index: -9999;
}
footer {
    height: 25px;
    padding-top: 10px;
    text-align: center;
    color: #efefef;
    background-color: 333333;
    letter-spacing: 1pt;
}
.clearfix { clear: both; }

It’s not actually working at the moment. For me, the footer is hidden below the screen. You must follow the instructions. As I said, there’s only a narrow window for success here.

Make sure to include a doctype at the top of your pages. E.g.:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">