问题描述:
只要在有padding-top的元素内 有<div class="clear"></div> 那就会出现双倍PADDING的 BUG
举例如下;
<!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>无标题文档</title>
<style>
<body> 效果预览: 解决方法: 2、写针对ie6和ie7的hack _padding,*padding. 部分转载自:
</style>
</head>
<div class="box" style="padding:30px; width:500px; background:#000;">
</div>
</body>
</html>
ie8 火狐下正常:
1、清除浮动的时候加上 overflow:hidden; height:0;[两者必不可少]