Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Wrong positioning

Featured Replies

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>

post-2193-126711309037_thumb.gif

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

  • 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

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>

  • 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. :D

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 :D

  • 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?

beaten to it by Andyl :D

 

:yahoo:

 

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 by andyl

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.