IE6 Border Bug

This is a funny little IE6 bug i dissected very recently while trying to make IE6 understand what my code is supposed to mean... As usual, fixing IE is a bloody pain in the buttocks.

The beauty of this bug lies in its simplicity: a block-level element (a DIV in this example) with a left border or a right border and some bottom padding. In addition to this, that element must have a block-level element (a P in this example) as last child. That's all we need.

Description of the bug: The first occurrence is just fine. In the next occurrences, the paragraph boundaries are correct (white background) but the text inside overflows horizontally. For each occurrence, the amount of overflow is increased by exactly twice the border width. In this example, the border width is 3em and the text overflows 6em in the second occurrence, 12em in the third, 18em in the fourth.

To fix the bug, either set the bottom padding to zero, or add a bottom border. I tried lots of different fixes, but those are the only two I found. Look at the source code, and see the commented CSS rule sets.

Most IE bugs can be hacked by forcing "hasLayout" on some element(s), but this always has some nasty side effects. It's better to do without it when possible. In this case, the hack consists in forcing "hasLayout" on the last child of our buggy element.

Enjoy!

This is a funny little IE6 bug i dissected very recently while trying to make IE6 understand what my code is supposed to mean... As usual, fixing IE is a bloody pain in the buttocks.

The beauty of this bug lies in its simplicity: a block-level element (a DIV in this example) with a left border or a right border and some bottom padding. In addition to this, that element must have a block-level element (a P in this example) as last child. That's all we need.

Description of the bug: The first occurrence is just fine. In the next occurrences, the paragraph boundaries are correct (white background) but the text inside overflows horizontally. For each occurrence, the amount of overflow is increased by exactly twice the border width. In this example, the border width is 3em and the text overflows 6em in the second occurrence, 12em in the third, 18em in the fourth.

To fix the bug, either set the bottom padding to zero, or add a bottom border. I tried lots of different fixes, but those are the only two I found. Look at the source code, and see the commented CSS rule sets.

Most IE bugs can be hacked by forcing "hasLayout" on some element(s), but this always has some nasty side effects. It's better to do without it when possible. In this case, the hack consists in forcing "hasLayout" on the last child of our buggy element.

Enjoy!

This is a funny little IE6 bug i dissected very recently while trying to make IE6 understand what my code is supposed to mean... As usual, fixing IE is a bloody pain in the buttocks.

The beauty of this bug lies in its simplicity: a block-level element (a DIV in this example) with a left border or a right border and some bottom padding. In addition to this, that element must have a block-level element (a P in this example) as last child. That's all we need.

Description of the bug: The first occurrence is just fine. In the next occurrences, the paragraph boundaries are correct (white background) but the text inside overflows horizontally. For each occurrence, the amount of overflow is increased by exactly twice the border width. In this example, the border width is 3em and the text overflows 6em in the second occurrence, 12em in the third, 18em in the fourth.

To fix the bug, either set the bottom padding to zero, or add a bottom border. I tried lots of different fixes, but those are the only two I found. Look at the source code, and see the commented CSS rule sets.

Most IE bugs can be hacked by forcing "hasLayout" on some element(s), but this always has some nasty side effects. It's better to do without it when possible. In this case, the hack consists in forcing "hasLayout" on the last child of our buggy element.

Enjoy!

This is a funny little IE6 bug i dissected very recently while trying to make IE6 understand what my code is supposed to mean... As usual, fixing IE is a bloody pain in the buttocks.

The beauty of this bug lies in its simplicity: a block-level element (a DIV in this example) with a left border or a right border and some bottom padding. In addition to this, that element must have a block-level element (a P in this example) as last child. That's all we need.

Description of the bug: The first occurrence is just fine. In the next occurrences, the paragraph boundaries are correct (white background) but the text inside overflows horizontally. For each occurrence, the amount of overflow is increased by exactly twice the border width. In this example, the border width is 3em and the text overflows 6em in the second occurrence, 12em in the third, 18em in the fourth.

To fix the bug, either set the bottom padding to zero, or add a bottom border. I tried lots of different fixes, but those are the only two I found. Look at the source code, and see the commented CSS rule sets.

Most IE bugs can be hacked by forcing "hasLayout" on some element(s), but this always has some nasty side effects. It's better to do without it when possible. In this case, the hack consists in forcing "hasLayout" on the last child of our buggy element.

Enjoy!