<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>空白边叠加bug--所有浏览器</title>
<style type="text/css">
*{margin:0;}
#box
{
margin:10px;
background-color:#cc9;
padding:1px;/*通过1px填充修复bug*/
}
p
{
margin:20px;
background-color:#69f;
}
</style>
</head>

<body>
  <div id="box">
    <p>嵌套在#box里的段落文本</p>
  </div>
</body>
</html>
 
 
没有padding:1px;的设置时,如下:
修复了之后: