Expanding div moving other div

This is a discussion on "Expanding div moving other div" within the Web Page Design section. This forum, and the thread "Expanding div moving other div are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jul 14th, 2006, 21:29
AdRock's Avatar
SuperMember

SuperMember
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to AdRock
Expanding div moving other div

Hello

I have a div (#content) which is used to display all the content. This div should be able to expand depending on how much content is in there. That isn't the problem.

I also have another div (#bottom) which is used for links and copyright information.

What i want to do is if the content div is very long, the bottom div is moved so that it directly underneath the content div at all times.

I am having trouble becuase the bottom div doesn't move and the content div is underneath

Here is the CSS i used:

#content {
width: 545px;
z-index: 1;
position: absolute;
padding: 5px;
top: 180px;
left: 220px;
overflow: visible;
border: none;

}

#bottom {
width: 545px;
height: 18px;
position: absolute;
background-color: #ffffff;
top: 800px;
left: 220px;
text-align: center;
}


If anyone could help it would help me out no end!!
Reply With Quote

  #2 (permalink)  
Old Jul 14th, 2006, 21:44
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: Expanding div moving other div

Your problem is because you have used
Code: Select all
position: absolute;
This styling instruction takes the element out of the natural flow and 'pins' it at a precise location, with respect to its containing element.

Give your 'content' div a
Code: Select all
position: relative;
Dont give it top and left values unless you have to tweak its location.

If the 'bottom' div is the next element after the 'content', then give that a
Code: Select all
position: relative;
also. It will then move down as the 'content' expands.

There may be issues that need to be addressed based on other styling code you have but you get the idea.
Reply With Quote
  #3 (permalink)  
Old Jul 14th, 2006, 22:28
AdRock's Avatar
SuperMember

SuperMember
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to AdRock
Re: Expanding div moving other div

I think i got it now.....many thanks for the quick reply
Reply With Quote
  #4 (permalink)  
Old Jul 15th, 2006, 10:21
AdRock's Avatar
SuperMember

SuperMember
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to AdRock
Re: Expanding div moving other div

That works a treat but I have a couple more questions.....

1. Can the content div have a minimum height so if there isn't much content the bottom div still stays at the bottom of the page?

2. I have a navigation div next to the content div. Can I set it so the navigation div is exactly the same height of the content div so it's level at the bottom?

Any help is greatly appreciated

Adam
Reply With Quote
  #5 (permalink)  
Old Jul 15th, 2006, 10:43
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: Expanding div moving other div

Yes you can. The css code is:
Code: Select all
min-height: 400px;
The only problem is the this doesn't work in IE, at least it is supposed to in IE 7 which is still in Beta, but it doesn't in earlier versions.

Try having the following sequence of css inplace.
Code: Select all
height: navheightpx;
overflow: visible;
Reply With Quote
Reply

Tags
expanding, div, moving, other

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Expanding Divs.. Need Help :( FXDesigns Web Page Design 10 Jan 30th, 2008 15:06
Div not expanding down Lchad Web Page Design 5 Feb 13th, 2007 19:37
DIV expanding too far Echilon Web Page Design 2 Dec 31st, 2006 15:39
expanding menu brunette JavaScript Forum 3 Dec 7th, 2006 22:56


All times are GMT. The time now is 19:25.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43