我有以下代码:
html:
<div class="container">
<div class="left">
<div class="panel">My Panel</div>
</div>
<div class="right"></div>
</div>
CSS:
.container {
background-color: #000;
margin: 130px auto;
min-height: 320px;
width: 940px;
overflow: auto;
padding: 0px 10px;
}
.left {
width: 600px;
margin-right: 20px;
}
.right {
width: 320px;
height: 300px;
background-color: #999;
float: right;
}
.panel {
background-color: red;
}
div 在边距顶部与.right
div 不一致。.left
div 显示在div.right
下方.left
。我如何对齐它,以便div仅在边距顶部.right
与 div 对齐?.left