1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>无标题文档</title>
6 <style type="text/css">
7 body { margin:0;}
8 #side { float: left; background:#99FF99; height: 300px; width: 120px;}
9 #main { background: #99FFFF; height: 300px;}
10 </style>
11 </head>
12
13 <body>
14 <script type="text/javascript">
15 var use = new Array(4)
16 var num = Math.floor(Math.random()*2)
17 //document.write(num)
18 //alert(use[num])
19 </script>
20 <div id="side">此处显示 id "side" 的内容</div>
21 <div id="main">此处显示 id "main" 的内容</div>
22 </body>
23 </html>
解决办法:
1、在side样式表中加入 这个属性 注意“_”是IE6能识别的, IE7不识别_margin-right:-3px; 但它不能通过W3C验证
2、当两列固定宽度时,最好把#main也固定宽度且向右浮动,这样就可以避免IE6的3像素bug了。