A子元素撐高了父元素,同級的B子元素如果要和父級元素高度一致,用display:table

A子元素撐高了父元素,同級的B子元素如果要和父級元素高度一致,父級容器用display:table;子級元素用display:table-cell;處理

<style type="text/css">
        body { background-color: #ffffff; padding: 20px; }
        .item01 { display: inline-block; padding-right: 10px; }
        .titleLeft { width: 120px; text-align: right; }
        i { color: #ff0000; } 
</style>
<div style="display:table;width:100%;">
	<div class="titleLeft" style="display:table-cell;height:auto;vertical-align: middle;padding-right:10px;"><i>*</i>文章編輯內容:</div>
	<div class="item01" style="display:table-cell;">
		<textarea id="editor_id" name="content" style="width:60%;height:500px;"></textarea>
		<div style="color:#c2c2c2;">
			當前狀態:
			<span id="statePublish" style="color:#c2c2c2;">未發佈</span>
		</div>
	</div>
</div>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章