I have two divs side by side. I\'d like the height of them to be the same, and stay the same if one of them resizes. I can\'t figure this one out though. Ideas?
To c
This is a common problem which many have encountered, but luckily some smart minds like Ed Eliot's on his blog have posted their solutions online.
Basically what you do is make both divs/columns very tall by adding a padding-bottom: 100%
and then "trick the browser" into thinking they aren't that tall using margin-bottom: -100%
. It is better explained by Ed Eliot on his blog, which also includes many examples.
.container {
overflow: hidden;
}
.column {
float: left;
margin: 20px;
background-color: grey;
padding-bottom: 100%;
margin-bottom: -100%;
}
Some content!
Some content!
Some content!
Some content!
Some content!
Something