In this case, I developed CSS code for this web application .. and sometimes the resulting data is too small, and the site footer is displayed in the middle of the page and looks weird.
I would like to press the space bar at the bottom of the browser, and then the footer. And if the page is long, this text will not overlap with the footer.
Can someone help me with this code right here?
I tried to use some of the codes that I found on this page: http://matthewjamestaylor.com/blog/keeping-footers-at-the-bottom-of-the-page , which talks about almost the same question, but I can not do it completely:
What am I doing wrong?
@charset "utf-8"; body { margin: 0; padding: 0; text-align: center; height:100%; position: relative; height:100%; } .spacer { clear: both; height: 0; margin: 0; padding: 0; font-size: 0.1em; } .spacer_left { clear: left; margin: 0 0 10px 0; padding: 0; font-size: 0.1em; } hr { height: 1px; margin: 20px 0 20px 0; border: 0; color: #ccc; background: #ccc; } #container { position:relative; height:auto !important; height:100%; min-height:100%; width: 1160px; margin: 0 auto; padding: 0; border: 1px solid #333; text-align: left; } h1#contexto { background:url('../images/menubarbg2.png'); width:1160px; height:30px; position:relative; margin-top:10px; visibility: inherit; font-family:Arial, Helvetica, sans-serif; font-size:12px; } #header { margin: 0; padding: 5px; height:70px; } h1#titulo { margin: 0; padding: 0 0 0; } #content { margin: -15px 20px 0 20px; padding:1em 1em 5em; } div#content.columns { margin-left: 100px; } #content abbr, #content acronym { cursor: help; border-bottom: 1px dotted; } #content ul { list-style-type: square; } #content ul li, #content ol li { margin: 0 0 0.4em 0; padding: 0; } #content blockquote { width: 75%; margin: 0 auto; padding: 20px; } #footer { margin: 0; height: -30px; padding: 5px; clear: both; bottom:0; position:relative; }
UPDATE: SOLUTION
@charset "utf-8"; body, html { margin: 0; padding: 0; text-align: center; position: relative; height:100%; } .spacer { clear: both; height: 0; margin: 0; padding: 0; font-size: 0.1em; } .spacer_left { clear: left; margin: 0 0 10px 0; padding: 0; font-size: 0.1em; } hr { height: 1px; margin: 20px 0 20px 0; border: 0; color: #ccc; background: #ccc; } #container { position:relative; min-height: 100%; height: auto !important; height: 100%; margin: 0 auto -30px; width: 1160px; padding: 0; border: 1px solid #333; text-align: left; } #header { margin: 0; padding: 5px; height:70px; } h1#titulo { margin: 0; padding: 0 0 0; } h1#contexto { background:url('../images/menubarbg2.png'); width:1160px; height:30px; position:relative; margin-top:10px; visibility: inherit; font-family:Arial, Helvetica, sans-serif; font-size:12px; } #content { margin: -15px 20px 30px 20px; } div#content.columns { margin-left: 100px; } #content abbr, #content acronym { cursor: help; border-bottom: 1px dotted; } #content ul { list-style-type: square; } #content ul li, #content ol li { margin: 0 0 0.4em 0; padding: 0; } #content blockquote { width: 75%; margin: 0 auto; padding: 20px; } #footer, .push { padding: 5px; clear: both; position:absolute; bottom:0; height: -30px; width:1150px; }
source share