首页 > 代码库 > 作列表排列时div的table属性应用

作列表排列时div的table属性应用

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>table</title>
    <style>
        .clear{clear:both;display:block;overflow:hidden;visibility:hidden;width:0;height:0}
        .clearfix:before,.clearfix:after{content:‘.‘;display:block;overflow:hidden;visibility:hidden;font-size:0;line-height:0;width:0;height:0}
        .clearfix:after{clear:both}
        .clearfix{zoom:1}
        .list{
            width: 800px;
            border: 1px solid #0f0f0f;
        }
        .list .l{
            width: 100px;
            float: left;
            min-height: 60px;
            line-height: 60px;
            color: #666666
        }
        .list .l .t{
            display: table-cell;
            line-height: 20px;
            height: 60px;
            vertical-align: middle;
            word-wrap:break-word
        }
    </style>
</head>
<body>
<div class="list clearfix">
    <div class="l">
        <div class="t">111</div>
    </div>
    <div class="l">
        <div class="t">比对执行比对执行比对执行比对执行</div>
    </div>
    <div class="l">
        <div class="t">333</div>
    </div>
    <div class="l">
        <div class="t">444</div>
    </div>
    <div class="l">
        <div class="t">555</div>
    </div>
</div>
</body>
</html>

 

作列表排列时div的table属性应用