The problem is when I try to set height: 20px
to all rows this breaks the natural width: 100%
from a block element. This bug only occurs on IE7 (tested on FF, Chrome and IE8).
HTML
<div id="container">
This must be adjusted to content
<div class="row">row 1</div>
<div class="row">row 2</div>
<div class="row">row 3</div>
<div class="row">row #</div>
</div>
CSS
#container {
border: 1px solid black;
position: absolute;
top: 10px;
left: 10px;
padding: 5px;
}
.row {
border: 1px solid blue;
margin-top: 2px;
height: 20px;
}
Demo
Notes
- I'm testing on IE8 with compatability mode for IE7
- Setting a fixed width to container and set
width: 100%
for rows is not an option.