首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > 跨浏览器开发 >

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

2012-03-05 
简单效果怎么兼容多浏览器HTML code!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN ht

简单效果怎么兼容多浏览器

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> 

热点排行