张秋桥:
适合IE8和其他浏览器的div table cell的解法。IE6/7不守规矩,要另外处理。
[阅读: 1969] 2010-04-15 18:45:41
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<style type="text/css">
.container {
display: table;
width: 100%;
}
.row {
display: table-row;
}
.cell {
display: table-cell;
width: 100px;
height: 100px;
background-color:#0F0;
}
.cell2{
display: table-cell;
height: 100px;
background-color:#F00;
}
</style>
</head>
<body>
<!--div>
<div style="width:10px; height: 200px; background-color:#0F0; float: left;"></div>
<div style="width:10px; height: 200px; background-color:#00F; float: right;"></div>
<div style="margin:0 10px; height: 200px; background-color:#F00;"></div>
</div-->
<div class="container">
<div class="row">
<div class="cell">aa</div>
<div class="cell2">bb</div>
<div class="cell">cc</div>
</div>
</div>
</body>
</html>