Forum Moderators: not2easy
I have a container with no pre-set height. inside that container I have a total of 5 <div>s (so 5 columns) now what I want it to do is take the height of the longest <div> and make all the other <div>s inside that container the same height. Make sense?
I hope it makes sense. If not, let me know and I can post a image.
Any help us appreciated.
Thanks in advance!
For your 5 column one just do that for each column.
Assign padding to some huge number that will surpass any of your page's content and then assign a negative margin that is equal to that padding.
Set your wrap to hide overflow on the Y.
In addition to whatever you already have for each item add where appropriate:
#wrap {
overflow-y:hidden;
}
#columnX {
padding-bottom:3000px;
margin-bottom:-3000px;
}
The bottom padding; negative botom margin; overflow-y (which is CSS3, so it'll make your code invalid to CSS2.1 checkers) might not be so well supported in all browsers. I'd like to see a list of browsers where the trick works. I remember doing something somewhat similar and having opera throw a fit over my code.
Anyway, there is a "big" caveat: your difference in column length is now limited to a fixed value in the CSS (3000px in the example), if you're a template maker that might be unusable as one can hardly predict maximum lengths.