我想垂直对齐另一个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