CSS - Footer Covering Content
Similar TutorialsThe page: http://new.midnighttempest.com/ As you can see, the content div is covering the footer, it sits just below the menu, whereas i want it to sit just below the content the php file: PHP Code: <?php define('IN_PHPBB', true); $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.' . $phpEx); include($phpbb_root_path . 'includes/functions_display.' . $phpEx); include($phpbb_root_path . 'includes/bbcode.' . $phpEx); // Start session management $user->session_begin(); $auth->acl($user->data); $user->setup(); page_header('Homepage'); $template->set_filenames( array( 'body' => 'main.html', ) ); $forumid = 14; $sql_array = array( 'SELECT' => '*', 'FROM' => array(TOPICS_TABLE => 't'), 'LEFT_JOIN' => array( array( 'FROM' => array(POSTS_TABLE => 'p'), 'ON' => 't.topic_first_post_id = p.post_id' ) ), 'WHERE' => 't.forum_id = ' . $forumid . ' AND MONTH(FROM_UNIXTIME(post_time)) = MONTH(CURDATE())', 'GROUP_BY' => 't.topic_id', 'ORDER_BY' => 'post_time DESC' ); $sql = $db->sql_build_query('SELECT', $sql_array); $result = $db->sql_query($sql); while($row = $db->sql_fetchrow($result)) { $url = "<a href='".$phpbb_root_path."viewtopic.php?f=".$forumid."&t=".$row['topic_id']."'>".$row['post_subject']."</a>"; $poster = "<a href='".$phpbb_root_path."memberlist.php?mode=viewprofile&u=".$row['topic_poster']."'>".$row['topic_first_poster_name']."</a>"; $date = $user->format_date($row['post_time'], false, false) . "</strong>"; $text = generate_text_for_display(smiley_text($row['post_text']), $row['bbcode_uid'], $row['bbcode_bitfield'], $row['enable_bbcode'] = $row['enable_smilies'] = $row['enable_magic_url'] = true); $avatar = '<img src="http://new.midnighttempest.com/download/file.php?avatar=2_1260394092.png" />';; $updates[] = '<table width="100%" border="0"> <tr> <td colspan="2"><strong>Title</strong>:'.$url.'</td> </tr> <tr> <td width="10%">'.$avatar.'</td> <td width="90%">'.$text.'</td> </tr> <tr> <td colspan="2"><strong>Posted On:</strong> '.$date.' <strong>by</strong> '.$poster.'</td> </tr> <tr> <td colspan="2"><hr/></td> </tr> </table>'; } $db->sql_freeresult($result); $template->assign_vars( array( 'UPDATES' => implode('', $updates), 'FORUMID' => $forumid ) ); page_footer(); ?> main.html Code: <!-- INCLUDE overall_header.html --> <div class="forabg" id="main"> <div class="inner"> <span class="corners-top"><span></span></span> <ul class="topiclist"> <li class="header"> <dl class="icon"> <span style="font-size: small">Updates</span> </dl> </li> </ul> <ul class="topiclist forums"> <li class="row" style="background: #CBA2DC; padding-left: 5px; padding-bottom:5px; padding-right:5px; padding-top:5px;"> <p> </p> {UPDATES} <p><a href="/viewforum.php?f={FORUMID}">View all previous updates</a> </p> </li> </ul> <span class="corners-bottom"><span></span></span> </div> </div> <div class="forabg" id="menu"> <div class="inner"> <span class="corners-top"><span></span></span> <ul class="topiclist"> <li class="header"> <dl class="icon"> <span style="font-size: small">Menu</span> </dl> </li> </ul> <ul class="topiclist forums"> <li class="row" style="background: #CBA2DC; padding-left: 5px; padding-bottom:5px; padding-right:5px; padding-top:5px;"> <!-- INCLUDE mt_menu.html --> </li> </ul> <span class="corners-bottom"><span></span></span> </div> </div> <!-- INCLUDE overall_footer.html --> mt_menu Code: <p><strong>Info</strong> <br /> <a href="/">Home</a><br /> About / Rules <br /> Join Form </p> <p><strong>Members</strong> <br /> Memberlist <br /> Card List <br /> Games <br /> Forum <br /> Donate <br /> Login </p> <p><strong>Other</strong> <br /> Affiliates <br /> Link to us <br /> Randomizer <br /> Staff Pay <br /> Credits <br /> Contact Us</p> css Code: /* Midnight Tempest Layout */ #main { position:absolute; width:70%; overflow:visible; z-index:1; } #menu { float:right; width:20%; overflow:visible; z-index:2; } hi, i have created a simple css layout and its displaying correctly in google chrome, firefox, IE 6 and IE 7. However, IE 8 is covering the 1px border on the left of the containing div section with the image contained within the logo. I tried adding a 1px padding and margin which only served to push the image over the right hand side border in IE 8. Does anyone know whats causing this issue? Here is my code below. Thanks in advance. First, the HTML code:- Code: <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'> <html xmlns='http://www.w3.org/1999/xhtml'> <head> <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' /> <meta http-equiv='Content-Language' content='en-us' /> <link rel='stylesheet' type='text/css' href='css/default.css' /> </head> <body> <div id='page'> <div id='logo'> <img src='gfx/siteLogo.jpg' alt='Our Website Logo' /> </div> </div> </body> </html> Now the css file:- Code: /* page structure definitions */ html { font-size: 100%; } body { margin: 0; padding: 0; /* 20px */ padding-top: 1.25em; padding-bottom: 1.25em; text-align: center; font-family: Verdana, sans-serif; background-color: white; /* 16px */ font-size: 1em; } #page { margin: 0; padding: 0; margin-left: auto; margin-right: auto; /* 900px */ width: 56.25em; /* 1px */ border: solid black 0.0625em; background-color: #ABBAD9; } #logo { margin: 0; padding: 0; /* 900px */ width: 56.25em; /* 150px */ height: 9.375em; } #logo img { margin: 0; padding: 0; /* 900px */ width: 56.25em; /* 150px */ height: 9.375em; } The image in the logo is 900px * 150px. I'm sure this has been asked, and I've googled for help without finding anything that works. I'm redesigning a site from html/tables -> css and need to keep a footer at the bottom of each page (after the content, not stuck to the bottom of the window). Being pretty unfamiliar with css positioning I'm having a bit of trouble. Site is here - huguenotbats . com / redesignfiles CSS is here - huguenotbats . com / redesignfiles / stylesheets / hbstyle . css As is everything works, but when I try to add a footer it sits on top of the content. Help, anyone?? Hello All, I am trying to put together what seems like it should be a simple css layout but it just is not cooperating. Thought maybe somebody could point out what I am doing wrong. The site is southernshades.net If you shrink the browser and scroll down the footer goes on top of the content area. I am going crazy trying to figure out how to get the footer to stay at the bottom. Any ideas would be greatly appreciated and save my sanity. Thanks. Hi, For some reason the bottom of my content is getting chopped off on some pages. For instance, the Bookmark icon and neighboring links are getting cut off at the bottom of this page when viewing with Google Chrome: http://www.sustainablelivingcolorad...ble-living-101/ Any ideas? Thanks. Is it possible to get my content to stick to my footer? I have a sticky footer at the bottom of my page and I would like the content to always bee 100% of the page and sitting right on top of the footer. I been messing around with different things for hours and nothing I seem to do will get my content box to stay stuck to the footer at the bottom of my page. Here is a link to the site printing.ou.edu/new-index.html This is what I am trying to get printing.ou.edu/Draft3.png Thanks for your help :-) (EDIT) I have Solved this problem sadly I had to use Java Script to get it done but it works. Here is the Java Script for anyone else trying to do something like this. Code: <script type="text/javascript"> window.onload = function() { contentHeight(); } window.onresize = function() { contentHeight(); } function contentHeight() { if (document.getElementById) { var windowHeight = getWindowHeight(); var headerHeight = document.getElementById('header').offsetHeight; var footerHeight = document.getElementById('footer').offsetHeight; var pushHeight = document.getElementById('push').offsetHeight; var menuHeight = document.getElementById('menu').offsetHeight; var contentElement = document.getElementById('content'); var contentbgElement = document.getElementById('content-bg'); contentElement.style.height = (windowHeight - (headerHeight + footerHeight + pushHeight + menuHeight)) + 'px'; contentbgElement.style.height = (windowHeight - (headerHeight + footerHeight + pushHeight + menuHeight)) + 'px'; } } function getWindowHeight() { var windowHeight = 0; if (typeof(window.innerHeight) == 'number') { windowHeight=window.innerHeight; } else { if (document.documentElement && document.documentElement.clientHeight) { windowHeight=document.documentElement.clientHeight ; } else { if (document.body && document.body.clientHeight) { windowHeight=document.body.clientHeight; } } } return windowHeight; } </script> See you all around Hi, I am generating what should be a simple css layout. I have a header, some left content (which is comprised of layers that hold an image and some over the top to form a kind of navigation tablet), some content to the right of that for text, and finally a footer. Bog standard design... The problem I have is that the content to the right of the left content is sat below both the left content and the footer currently. What it should be doing is sitting to the right of the left content and where the text 'grows' push the footer down the page: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="generator" content="HTML Tidy for Linux (vers 1 September 2005), see www.w3.org" /> <title>Title</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style type="text/css"> /* mac hide \*/ html, body {height:100%} /* end hide*/ body { padding:0; margin:0; color: #000000; } #wrapper { position: relative; min-height: 100%; height: auto !important; height: 100%; } #header{ position:absolute; top:0; left:0; width:100%; height:224px; border-top:0px solid #feffff; border-bottom:0px solid #feffff; overflow:hidden; color: #000000; } #content { background-color: #ccc; padding-bottom: 50px; } * html #footer {/*only ie gets this style*/ \height:40px;/* for ie5 */ he\ight:38px;/* for ie6 */ } #navlist li { list-style: none; margin: 0; padding: 0.25em; border-top: 0px white; } #navlist li a { color: #4E261B; text-decoration: none; font-family: palatino linotype, helvetica, sans-serif; font-size: .90em; line-height: 200%; } a{ font-family: Tempus Sans ITC; color: #4E261B; font-weight: bold; font-size: 14pt; } #content { background-color: white; padding-bottom: 50px; padding-left: 200px; padding-top: 0px; } #footer { background-color: #ff0; width: 100%; height: 50px; line-height: 50px; position: absolute; bottom: 0 !important; bottom: -1px; } </style> </head> <body> <div id="wrapper"> <div id="header"> <img border="0" src="images/Banner_flat.jpg" alt="Banner" width="100%" height="224" align="left" /> </div> <div style="position: absolute; width: 169px; height: 243px; z-index: 1; left: 4px; top: 229px" id="layer1"> <img border="0" src="images/bridetablet1.bmp" alt="Menu" width="190" height="302" /></div> </div> <div style="position: absolute; width: 169px; height: 243px; z-index: 2; left: 14px; top: 257px" id="layer2"> <div id="navcontainer"></div> <ul id="navlist"> <li><a href="hello" class="c2">Home</a></li> <li><a href="About%20Us" class="c2">About Us</a></li> <li><a href="User%20Register" class="c2">User Register</a></li> <li><a href="User%20Log-In" class="c2">User Log-In</a></li> <li><a href="Supplier%20Log-In" class="c2">Supplier Log-In</a></li> <li><a href="Join" class="c2">Join</a></li> </ul> </div> <div id="content"> <p>Stuff.</p> <p>Blah, blah blah</p> <p>Blah, blah blah</p> <p>Blah, blah blah</p> <p>Blah, blah blah</p> <p>Blah, blah blah</p> <p>Blah, blah blah</p> <p>Blah, blah blah</p> <p>Blah, blah blah</p> <p>Blah, blah blah</p> <p>Blah, blah blah</p> <p>Blah, blah blah</p> <p>Blah, blah blah</p><p>Blah, blah blah</p> <p>Blah, blah blah</p> <p>Blah, blah blah</p> <p>Blah, blah blah</p> <p>Blah, blah blah</p> <p>Blah, blah blah</p> <p>Blah, blah blah</p> <p>Blah, blah blah</p> </div> <div id="footer"> <p>Footer</p> </div> </div> </body> </html> Thanks, G http:// 192.168.0.253/ index.php?option=com_content&view=article&id=50&Itemid=67 I need for the content to stack in front of content (as it currently does) so the content appears to scroll behind it. BUT - I need for the footer to sit at least below the fold so that it isn't so obtrusive. I'm tired of googling and can't spend any more hours trying to get it to work!! It's an artisteer template, joomla. Help? THANK YOU!! Hey gang, I'm sure this has been asked many times, but i cannot find the words to search for this. Luckily, I'm sure it is a quick fix. I'm not great with CSS, but I feel I have a strong understanding. However, I must not completely understand divs, because when I try to add padding to this "right content" div, it pushes itself behind the footer div (the bright green box): The box on the left is the "left-content", the box on the right is "right-content." Each of the boxes are floated left and right, respectively, and they are both in a "container" div that centers them. How can I make the footer div just be pushed down with content is added to either the right/left-content div? I can add a bunch of "<br />s after the last bit of content, and the footer moves down, but I feel it is cleaner to just add 20x padding. Any help is greatly appreciated! I have a container div which includes a #header div, a left-floated #content div, a #right div, and a #footer div. The #content div has a background image that does not want to extend all the way down within the div to snuggly join the footer in any IE browser. I've tried the Holly hack, adding a line-height, relative positioning but to no avail. The stylesheet is embedded in the html file. Here's the link: http://www.emaycreations.net/BuildWebsiteIII/Week6/finalexamPractice.html It looks great in NN, FF and Opera but neither IE 5 nor 6 displays the page correctly. Can anyone help? Mari-Anne in Montana Hi I'm having a bit of trouble with a DIV/CSS layout - 2 DIVs are inside a 100% height 100% width container DIV. The first (top) DIV is the content and the second (bottom) DIV being a 100% width 240px height footer DIV. I can make the footer stick to the bottom of the page and display fine no problem, however, I am having trouble getting the content div to fill only the area above the footer. If I specify a 100% height for it then it extends the entire height of the page and content disappears behind the footer. Plus, I want to absolutely center the content in the space above the footer, not the absolute center of the whole page, which is all i am acheiving with 100% height! Basically, I need the content DIV to extend 100% then subtract the 240px height of the footer - I suspect it's not wise to mix px and %, however. I have attached an image to help with my probably confusing explanation! I do have a workaround using tables, which I would ideally like to avoid, particularly as it does not support IE6/7 browsers. If a solution can be acheived which uses JavaScript to format the DIVs, then I am open to any suggestions anyone may have. Thanks R Here's how the footer looks now: And here's the desired result: Any ideas? It'll have to be cross-browser friendly (even IE6, god help me). Thanks! I'm trying to use CSS to create a layout that has a top header, followed by a left side navbar, a center content area, and a bottom footer. I'm totally lost by the CSS needed to make this happen. Here's what I'm trying. It's borrowed from other posts that came up by searching for headers and footer. Any help would be fantastic. I'm trying to end my use of frames for the header and navbar. Thanks in advance for any help. Code: #header { left: 0; width: 100%; height:125px; top: 0; background-image: url(images/topbackground2.jpg); background-repeat: repeat; } #navbar{ width:122px; height:100%; background-color:#3f79a1; position: absolute; top: 125px; left: 0px;} #footer{ background-image: url(images/gradientsmaller2.gif); font: 10pt; position: absolute; bottom: 0; left:0; background-color: #ccffcc; width: 100%; text-align: center; padding: 0 15%; } I have created a CSS site that has a footer spanning the bottom of the viewport and whilst I have managed to glue it to the bottom I have another div that is behind it even though I think I have set-up the container properly. The troublesome page is http://www.cimbian.co.uk/BognorArchers/recurve.htm and you will see that the bottom of the text in the main pane is obscured by the footer. Basically I have a meta-wrapper for the whole page: and then have the main content within it. Following on from the content I have the footer and then I close the meta-wrapper. Something like this: <div id="meta_wrapper"> <div id="BA_main_content_area" class="clearfix"> <div id="BA_Main_Full_Width"> </div> <div id="footer"> </div> </div> My CSS for this is: div#meta_wrapper { width: 760px; margin-left: auto; margin-right: auto; background-color: yellowgreen; text-align: left; position: relative; min-height: 100%; height: 100%; voice-family: "\"}\""; voice-family: inherit; } html>body #meta_wrapper { height: auto; } div#BA_main_content_area {width:760px; align: center; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; font-size: 0.85em } div#BA_Main_Full_Width { border:3px inset yellow; font-family: Verdana; font-size: 0.85em; text-align: justify; position: relative; width: 500px; margin: 10px 30px 0px 10px; padding: 3px; background-color: #FFFFCC; float: left; } div#footer { position: absolute; bottom: 0; width:760px; padding:4px 0; font-size: 0.6em; text-align: center; background-color: white; /* Blue */ border-top:1px solid yellow; border-bottom:2px solid yellow; margin-top:1.5em;} /* orange border */ The problem occurs in IE and in Netscape so although I have box-model problems due to IE in Firefox the problem is not limited to IE. As far as I can tell from much web-reading and a couple of books this should do it. Any thoughts? PS: I also posted this in the MS FP forum as I built the page in FP but have not yet found a solution so please don't yell if you have seen the post there too ;-) I actually have two problems... Installing hte firebug plugin for firefox may ease helping me out... The problem is with http:// kthxbai2u<dot>com I cant for the life of me center the "content" div. I have tried every method I found on the first 4 pages of Google. The only thing I can think of is that it is inheriting something wierd or I am missing something simple... The second problem, I can't seem to make the left and right side bar expand to meet up with the footer wayy down at the bottom of the page. I want that div to make a column the whole way down. If anyone can help me out, it would be more than appreciated! Thanks I want to do this design: http://hermann.sonyextreme.com/upload/design.png * means it should be "the rest". Just like when working with frames. So the sites height is 100% and width is 800px. I've set it up like this: Code: <div id="container"> <div id="header"> </div> <div id="main"> <div id="menu"> </div> <div id="content"> </div> </div> <div id="footer"> </div> </div> But no matter what I try, the css just keeps ****ing with me So do you have any tricks/know any sites who have done this succesfully... or just anything to help me, then I'd love to hear from you Thanks in advance Hermann |