2012-03-19 78 views
0

我创建了下面的演示不工作:膨胀溢出在Internet Explorer

http://thedrivepartnership.com/overflow.html

的滚动扩大在Firefox/Chrome的罚款,但在IE中它只是似乎要工作。

有没有人遇到过这个问题。

CSS

body {padding:0px; margin:0px;} 

.wrapper { 
    position:absolute; 
    top:0px; 
    bottom:0px; 
    width:100%; 
    height:100%; 
    background:red; 

} 

.block1 { 
    position:absolute; 
    top:0px; 
    right:0px; 
    width:70%; 
    height:50%; 
    background:green; 

} 

.block2 { 
    position:absolute; 
    bottom:0px; 
    right:0px; 
    width:70%; 
    height:50%; 
    background:blue; 

} 
.heading {width:100%; height:50px; background:black;} 

.scroll { 
    overflow-y:scroll; 
    overflow-x:hidden; 
    width:100%; 
    position:absolute; 
    float:left; 
    top:50px; 
    bottom:0px; 
    zoom:1 
} 

HTML

<div class="wrapper"> 
<div class="block1"> 
<div class="heading"></div> 
<div class="scroll"> 
<!--content here --> 
</div> 
</div> 


<div class="block2"> 
<div class="heading"></div> 
<div class="scroll"> 
<!--content here --> 
</div> 
</div> 
</div> 

回答

1

你的设计在IE中正常工作,你只需要在你的文件的第一行首先声明一个DOCTYPE。

<!DOCTYPE html> 
+0

溢出x/y在IE8或更低版本中不受支持。 http://www.w3schools.com/cssref/css3_browsersupport.asp – Luuky19 2012-03-19 13:34:19

+0

@ Luuky19页在IE8中正常工作,适合我使用DOCTYPE。 – 2012-03-19 13:37:46

+0

虽然在IE6中不起作用:S – user1177860 2012-03-19 13:45:27