+ -
当前位置:首页 → 问答吧 → [急]div relative相对定位时IE7不会撑开父DIV而IE6会

[急]div relative相对定位时IE7不会撑开父DIV而IE6会

时间:2009-03-23

来源:互联网

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="1.aspx.cs" Inherits="_1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <title></title>
  <style>
  div{
border:1px dotted black;

}
#top
{
  height:50px;
  }
  #top1
{
  height:10px;
  }
  #top2
{
  position:relative;
  height:300px;
  width:300px;
  left:20px;
  top:10px;
  }
  </style>
</head>
<body>
  <form id="form1" runat="server">
  <div id="top">
  <div id="top1"></div>
  <div id="top2"></div>
  </div>
   
  </form>
</body>
</html>
在IE6中top2会把top撑开,而在IE7中就不会,我现在想按不撑开的显示,也就是IE7的,怎么办??

作者: snyyh5   发布时间: 2009-03-23

已经解决了 
top 

  height:50px; 
overflow:hidden;
  } 

作者: snyyh5   发布时间: 2009-03-23

但是 问题又来了 在firefox下 超出的部分显示不了 在IE6/7下可以!!!

作者: snyyh5   发布时间: 2009-03-23

#top2
{
  position:relative;
  height:300px;
  width:300px;
  left:20px;
  top:10px;
  z-index:1000;
}

作者: peanut_love   发布时间: 2011-05-13

top  
{  
  height:50px;  
overflow:hidden;
overflow:;auto!important
  }  

作者: jywcyx   发布时间: 2011-05-13