我想垂直對齊另一個div在底部的div,我不想使用相對/絕對定位。下面是我的標記。它似乎工作。但我不確定這是否是最佳解決方案。任何人都可以推薦更好的方法?另外,在FF中,如果我刪除容器周圍的邊框,它將停止工作。有誰知道爲什麼? 感謝 康斯坦丁試圖垂直對齊格內div
<html>
<head>
<style type="text/css">
.container
{
background-color: #ffff00;
height: 100px;
line-height: 100px;
border: solid 1px #666666;
}
.container .content
{
margin-top: 60px;
background-color: #ffbbbb;
height: 40px;
line-height: 40px;
}
</style>
</head>
<body>
<div class="container">
<div class="content">test</div>
</div>
</body>
</html>
我用過這個。謝謝。同時我想把它放在中央。怎麼做 ? – 2014-03-13 07:04:21