display
包含ブロックのプロパティを に設定し、プロパティが に設定され、プロパティが に設定さtable
れたボックスで子孫ブロック ボックスを囲むと、これらのボックスのプロパティが に設定されている場合と同じ効果があることがわかりました。display
table-cell
vertical-align
top
float
left
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>simulating float</title>
<style type="text/css">
#container {
background-color: darkgrey;
margin: 10px;
padding: 10px;
height: 240px;
display: table;
}
.box {
margin: 5px;
width: 240px;
height: 240px;
background-color: grey;
}
.float {
display: table-cell;
vertical-align: top;
}
</style>
</head>
<body>
<div id="container">
<div class="float">
<div class="box"></div>
</div>
<div class="float">
<div class="box"></div>
</div>
<div class="float">
<div class="box"></div>
</div>
</div>
</body>
</html>
誰かがこれについて説明してもらえますか?ありがとう。