User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the HTML and CSS section within the Web Development category of DaniWeb, a massive community of 397,664 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,361 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our HTML and CSS advertiser: Lunarpages Web Hosting

Placing one div within another

Join Date: Feb 2005
Posts: 427
Reputation: autocrat is on a distinguished road 
Rep Power: 4
Solved Threads: 12
autocrat autocrat is offline Offline
Posting Pro in Training

Re: Placing one div within another

  #2  
Aug 18th, 2007
Well, for a start, if you want a "fluid" page for things like height.... you can't use position:absolute!
You are tellign the browsers to stick something "THERE", so no matter what happens, it will not move.

Additionally, you may find it easier if you stop using height: as well.

In IE, it will treat height: as min-height:.
Where as proper Browsers will treat height: as an explicit isntruction, and will not stretch!
Instead content will break out of it.


So, try it more "organicly"... simply place the divs in the order you want for the column, and let the content sort itself out regarding height.

Trust me...

<div id="rightcolumn">
<div id="box1">
</div>
<div id="box2">
</div>
<div id="box3">
</div>
<div id="box4">
</div>
</div>

Will give you the right-hand column, with 4 blocks for content... as each one fills in, it will automatically stretch to contain the content.
Better yet, it will also push those below it further down!

Overstyling is a common occurence, and it takes a bit to realise some of the "default logic" that is inherant in CSS.

So keep it simply, make a new page, and simply put coloured boxes in the order you want.

I t should do what you want automatically!
Reply With Quote  
All times are GMT -4. The time now is 11:54 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC