简体   繁体   中英

Position absolute in Internet Explorer

My website looks good on all browsers but Internet explorer.All the elements that have position:absolute are messed up . I tried to add left:0px rule but that didn't fix it.How can i fix the problem ?

Thank you !

Link to my website : Click Here

position:relative上的“main”元素更改为position:absolute就行了。

The default is position:static for the parent (main) and this causes children with position:absolute to be absolute to the page. Making position:relative for main causes the children to be absolute within the main. It seems likely the IE difference is because it just happens to look okay in other browsers. See CSS tricks for more info. This example works in internet explorer and most others.

<html>
<head>
<style>
.outer { position:relative; height:100px; border:1px solid black; }
.inner { position:absolute; bottom:0px; }
</style>
</head>
<body>
<div class=outer>
    <div class=inner>
        This is some text.
    </div>
</div>
</body>
</html>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM