Negative top margin not working in IE 8 or 9

前端 未结 5 599
悲哀的现实
悲哀的现实 2020-12-14 07:56

I have a div with margin-top:-200px. I want the div to move up/behind the div above it.

Works great in all browsers except IE so far. margin-top:

5条回答
  •  执笔经年
    2020-12-14 07:59

    IE doesn't like negative margins and doesn't render them properly. Position your elements relatively or absolutely and use top: -200px instead.

    Note: positioning them may change the layout significantly and you may have to rework your styles.

提交回复
热议问题