tags:

views:

26

answers:

1

How can I prevent the left padding from being lost in IE7 (IE8 compatibility mode) in the following example once the element jumps to the next line down?

http://www.andrewherrick.com/spike/ie7paddingwrap.html

A: 

The fix is the following: Add 10px to the wrap and 2px to the margin-left.

.wrap
    {
        width: 210px;
    }

.elm
    {
        background-color: #333;
        color: #fff;
        line-height: 30px;
        font-weight: bold;
        padding: 3px 4px;
        margin: 2px 2px 2px 2px;
        white-space: nowrap;
    }
Erik
Thanks for your reply but this does not work as it does fix this when the length of the element is variable. See the page now to see what I mean.
aherrick