•
•
•
•
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
![]() |
•
•
Join Date: Jul 2007
Posts: 15
Reputation:
Rep Power: 2
Solved Threads: 0
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 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?
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
Is it more likely that I am not setting up the divs correctly or am I missing something else?
You must set attributes to main content div, because it will dependent by the size of content inside.
I have this:
Btw> Internet Explorer ignore attribute min-anything, there is height the same as min-height in Opera, FF...
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.
P.S. Sorry for my English, I am autodidact :)) In school I have only German.
•
•
Join Date: Jul 2007
Posts: 15
Reputation:
Rep Power: 2
Solved Threads: 0
•
•
•
•
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?
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.
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
![]() |
•
•
•
•
•
•
•
•
DaniWeb HTML and CSS Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- how to change the size of Element Id's runtime in css (HTML and CSS)
- Open In New Window Php (PHP)
Other Threads in the HTML and CSS Forum
- Previous Thread: Sound on link
- Next Thread: page loading times



Linear Mode