February 25, 201016 yr Hello, Using the picture attached I have added a border around the footer, what i am wanting is when more content is added to the three seperate text column the footer moved down below the content but this is not happening I can figure out why either. Below is my css I am using, i Think it is to do with the #content 1,2 & 3 part as i struggled to get them all side by side which i think has affected the way in which the footer should operate. Anyway all i am wanting is the footer to move down as more text is added to the content sections #container {position:relative;width:750px;margin: 0 auto;background: #fff;z-index:80;text-align:left;} #header {position:relative; width:750px;height:100px; } .header {position:relative; margin: 30px 0px 0px 10px; float:left;} #nav {position:relative;float:right; margin: 70px 20px 20px 0px} #nav a:link { color: #438016;font-size:12px} #subheader {position:relative; width:750px;height:180px;background:url(grass.gif); } #login { position:relative; margin: 30px 10px 0px 400px; float:right; font-size: 12px; color: white; } #content {position:relative; width:750px;height:200px; } #content1{ position:relative;width:235px; margin:10px 0px 0px 10px;float:left;} #content2{ position:relative;width:235px; margin:10px 0px 0px 0px; float:right;background-color:grey;border-style:dashed} #content3{ position:relative;width:235px; margin:10px 10px 0px 10px; float:right;} #footer {position:absolute; width:750px;height:100px; margin:50 0 0 0; border-style:dashed; } Also below is the html code to accompany the above. <html> <head> <title> test</title> <link rel="stylesheet" type="text/css" href="style1.css"/> </head> <body> <div id="container"> <div id="header"> <div id="nav"> <a href=""> HOME | </a> <a href=""> LISTINGS | </a> <a href=""> ADVERTISE | </a> <a href=""> CONTACTS </a> </div> <img src="header.gif" alt="header" class="header"> </div> <div id="subheader"> <div id="login"> <form method="POST" action=""> <div align="center"> Owner Login </div> Username: <input type="text" name="username" size="15" /><br /> Password: <input type="password" name="password" size="15" /><br /> <div align="right"> <p><input type="submit" value="Login" /></p> </div> </form> </div> </div> <div id="content"> <div id="content1"> lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum </div> <div id="content2"> lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum </div> <div id="content3"> lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum lorum esporum dorum </div> </div> <div id="footer"> </div> </div> </body> </html>
February 25, 201016 yr Could do with seeing the html or a link may be position absolute on the footer but I'm only guessing without seeing the html
February 25, 201016 yr Author Could do with seeing the html or a link may be position absolute on the footer but I'm only guessing without seeing the html I have added it to original post. Thanks
February 25, 201016 yr Try changing: #footer {position:absolute; width:750px;height:100px; margin:50 0 0 0; border-style:dashed; } To this: #footer {position:absolute; width:750px;height:100px; margin:50 0 0 0; border-style:dashed; clear:both; } Otherwise, add this after your content3 div: <div style="clear:both;"><!--Clear--></div>
February 25, 201016 yr Author Try changing: #footer {position:absolute; width:750px;height:100px; margin:50 0 0 0; border-style:dashed; } To this: #footer {position:absolute; width:750px;height:100px; margin:50 0 0 0; border-style:dashed; clear:both; } Otherwise, add this after your content3 div: <div style="clear:both;"><!--Clear--></div> Thanks a lot that worked great.
February 25, 201016 yr Give this a try just before your closing tag content add <div class="clear"></div> then in your css add .clear{clear:both;width:100%;height:0;font-size:0;} add remove height from #content beaten to it by Andyl
February 25, 201016 yr Author Another thing I was going to ask you experts is I had a lot of trouble getting the 3 content columns to line up. Is my css OK or is there an easier way?
February 25, 201016 yr beaten to it by Andyl Another thing I was going to ask you experts is I had a lot of trouble getting the 3 content columns to line up. Is my css OK or is there an easier way? Looks good to me, I don't really use 'position' - just floats and margins, but it's your choice. EDIT: Just noticed you're using a form. To avoid form display issues in the dreaded IE, add this to your CSS: CSS form{ margin:0; padding:0; } Edited February 25, 201016 yr by andyl
Create an account or sign in to comment