2
如何使左右區域在頂部和底部區域之間對齊?看起來它們雖然具有相同的高度,但並未對齊。請注意,左側和右側的div沒有相同長度的文本。任何人都可以幫助請求。CSS,如何將兩個div之間的兩個div像漢堡一樣對齊?
HTML
<div id="top_area"></div>
<div class="left_area">I'm left area, which has longer text</div>
<div class="right_area">right area</div>
<div id="bottom_area"></div>
CSS
<style>
#top_area{
width:550px;
height:100px;
background-color: orange;
}
.left_area{
box-sizing: border-box;
display: inline-block;
background-color: #ffcc99;
width:140px;
height:80px;
padding-top:30px;
}
.right_area{
box-sizing: border-box;
display: inline-block;
background-color: #ffcc99;
width:140px;
height:80px;
padding-top:30px;
margin-left: 15%;
}
#bottom_area{
min-height: 80px;
text-align: center;
padding: 10px;
background-color: orange;
width: 550px;
border-radius:5px;
display: block !important;
text-align: left;
vertical-align: bottom;
}
</style>