日期:2014-05-16  浏览次数:20866 次

CSS+DIV样式时,如果div值为空,仍然占位。CSS大神来看看!!
<html>
    <head>
        <title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<style>
.div_tab {
}
.div_tab .cell {
float: left;
margin-left: 5px;
word-break: break-all;
word-wrap: break-word;                                             
}
/* 五列 */
.div_tab .cell.w_03 {
width: 17%
}

.clear {zoom:1; clear:both;}
</style>
    </head>
    <body>

<hr />
<div class="div_tab">
<div class="cell w_03">XXXXXX</div>
<div class="cell w_03">XXXXXX</div>
<div class="cell w_03">XXXXXX</div>
<div class="cell w_03">XXXXXX</div>
<div class="cell w_03">XXXXXX</div>
<div class="clear" />
<div class="cell w_03">XXXXXX</div>
<div class="cell w_03">XXXXXX</div>
<div class="cell w_03">XXXXXX</div>
<div class="cell w_03">XXXXXX</div>
<div class="cell w_03">XXXXXX</div>
<div class="clear" />
<div class="cell w_03">XXXXXX</div>
<div class="cell w_03">XXXXXX</div>
<div class="cell w_03"></div>
<div class="cell w_03"></div>

<div class="cell w_03">XXXXXX</div>
</div>
  
    </body>
</html>

红字部分值为空时,后面的会占据前面的空值得位置。
现在的要求就是空的值 空着 但是还是占据着位置  xxxxx
第三行的  第三四列为空 ,第五列 才显示 


------解决方案--------------------
div给min-height:1px;