当前位置: 代码迷 >> 跨浏览器开发 >> 简单效果如何兼容多浏览器
  详细解决方案

简单效果如何兼容多浏览器

热度:10041   发布时间:2013-02-26 00:00:00.0
简单效果怎么兼容多浏览器
HTML code
<!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>    <title>无标题页</title>    <style type="text/css">    .p1{        border:solid 2px red;        width:200px;        height:100px;    }    .p2{        border:solid 2px blue;        width:200px;        height:200px;    }    </style></head><body>    <div class="p1">        <div class="p2"></div>    </div></body></html>ie6显示的两个DIV一样大,而其他浏览器 p2都比p1大真想把IE6杀了。我在p1中加了 overflow:hidden   其他浏览器的两个DIV一样大了。郁闷如何让IE6和其他浏览器显示一样。


------解决方案--------------------------------------------------------
HTML code
  <!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>       <title>无标题页 </title>       <style type="text/css">      .p1{          border:solid 2px red;          width:200px;          height:100px;      position:relative;     }      .p2{          border:solid 2px blue;          width:200px;          height:200px;      position:absolute;     }       </style>   </head>   <body>       <div class="p1">           <div class="p2"> </div>       </div>   </body>   </html>
  相关解决方案