I have several divs and i need them to fill content height so that every div has the same height. Their height must respond to browser window resizing, so it can’t be fixed. Number of divs can vary between 7 and 12.
I don’t know if this can be done with pure css or jquery must be involved.
Before:
original divs http://imageshack.us/a/img14/9964/23446096.jpg
After:
resized divs http://imageshack.us/a/img42/9183/76164750.jpg
This wasn’t nearly as bad as I thought. See code below:
HTML
CSS
(Borders for visual reference only) Adjust the height and top positions of the divs according to how many divs there are (100% / number of divs, starting from 0). According to a comment on this question, it doesn’t work in IE8, but I have no way of testing that at the moment. Confirmed working in IE9, IE9 with Compatibility Mode, Chrome 24, and FF 18.