I have written this html, in Firefox, it displayed perfect what I want(the blue part is sticked to the bottom of the page). But in IE it didn't display right way, how can I modify the HTML so that the blue part can be at the left bottom of the page?
In addition, the red part is also not the same, can I modify HTML to make the red part the same in IE and firefox?
I am using IE8 and Firefox 3.6.12
Thanks in advance.
<html>
<head>
<style type="text/css">
</style>
</head>
<body>
<div id="main" style="">
<div id="left_to开发者_JAVA技巧p" style="width:800px;float:left;background-color:pink;">left_top</div>
<div id="left_bottom" style="width:800px;float:left;background-color:blue;bottom:0px;position:fixed;">left_bottom</div>
<div id="right_all" style="width:200px;float:right;height:100%;background-color:red;">right_all</div>
</div>
</body>
</html>
EDIT: Add another question: Is it possible to use script to stick it to the bottom?
I tried to add a line in front of all code:
It works! But I don't know why.
IE6 doesn't understand position: fixed;
here's an article explaining how to get around that: http://ryanfait.com/resources/fixed-positioning-in-internet-explorer/
that will solve the problem with the bottom div.
Since the above solution would break all position:absolute on IE6 I suggest another method I developed some times ago
http://css.html.it/articoli/leggi/3074/position-fixed-performante-su-ie6/
http://www.html.it/articoli/3074/demo2.html (view source code demo here)
http://www.html.it/articoli/3074/demo.zip (demo download)
精彩评论