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 402,652 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,147 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
Views: 607 | Replies: 4
Reply
Join Date: Jul 2007
Posts: 15
Reputation: Persist01 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Persist01 Persist01 is offline Offline
Newbie Poster

Column height dependent on content column

  #1  
Apr 21st, 2008
Hi,

I have 3 div columns. Columns 1 and 3 have different colored backgrounds. Column 2 is white background and contains the content.

I want the heights of columns 1 & 3 to increase according to the height or the amount of content in column 2.

I have tried using
height=auto
in the css for columns 1 and 3 but it doesn't seem to keep the height set to the height of column 2.

Is it more likely that I am not setting up the divs correctly or am I missing something else?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2008
Location: Slovakia
Posts: 61
Reputation: lio04 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 4
lio04's Avatar
lio04 lio04 is offline Offline
Junior Poster in Training

Re: Column height dependent on content column

  #2  
Apr 22nd, 2008
You must set attributes to main content div, because it will dependent by the size of content inside.

I have this:

#content {
	width: 545px;
	min-height: 600px;
	margin-top: 3px;
	border: 1px solid gray;
	background-color: black;
	float: left;
}

Btw> Internet Explorer ignore attribute min-anything, there is height the same as min-height in Opera, FF...
Jabber: lio04(at)jabbim(dot)sk
P.S. Sorry for my English, I am autodidact :)) In school I have only German.
Reply With Quote  
Join Date: Jan 2007
Posts: 2,537
Reputation: MidiMagic is on a distinguished road 
Rep Power: 7
Solved Threads: 111
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Posting Maven

Re: Column height dependent on content column

  #3  
Apr 22nd, 2008
Careful. Putting size styles (width, height) and surrounding styles (margin, border, padding) in the same style or tag causes IE/FF incompatibilities.

Nest two divs, ome with the sizes, and the other with the surrounding styles.
Daylight-saving time uses more gasoline
Reply With Quote  
Join Date: Jul 2007
Posts: 15
Reputation: Persist01 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Persist01 Persist01 is offline Offline
Newbie Poster

Re: Column height dependent on content column

  #4  
Apr 22nd, 2008
Originally Posted by MidiMagic View Post
Careful. Putting size styles (width, height) and surrounding styles (margin, border, padding) in the same style or tag causes IE/FF incompatibilities.

Nest two divs, ome with the sizes, and the other with the surrounding styles.


Ok thanks.

Lio04 - how will columns 1 & 3 change their height with what you have for the main content div? What do you have for the divs for columns 1 & 3?

MidiMagic - from what you have suggested for the div with the sizes - do I need to mention height in this div if the columns 1 & 3 are relying on the height of column 2?
Reply With Quote  
Join Date: Jan 2007
Posts: 2,537
Reputation: MidiMagic is on a distinguished road 
Rep Power: 7
Solved Threads: 111
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Posting Maven

Re: Column height dependent on content column

  #5  
Apr 28th, 2008
Divs are implemented poorly. They usually will not expand larger than their own contents.

This might be one of the cases where table works better than div. Table forces all of the columns to be the same height.

The use of table is not deprecated. What is being discouraged is using table to create margins and padding.
Daylight-saving time uses more gasoline
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb HTML and CSS Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the HTML and CSS Forum

All times are GMT -4. The time now is 3:15 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC