[英]aligning div content within a div
我有2列div左列是導航欄,右列是頁面內容
在chrome中,所有顯示均正確,但是在chrome中,第二列的內容顯示為第二列,但是其顯示從導航欄的底部開始,而導航欄的高度保留為content列中的空白
請告知我該如何補救
#wrapper { margin-left: 250px; position: relative; margin-top: 0; top: 0; } #content { float: right; width: 100%; margin-left: 5px; background-color: white; } #sidebar { float: left; width: 250px; margin-left: -250px; background-color: #FFA; } #cleared { clear: both; } body { font: 11px 'Trebuchet MS'; color: #404040; } fieldset, legend { margin: 0; padding: 0; width: 100%; height: 100%; top: 0; }
<div id="wrapper"> <div id="sidebar"> <cfinclude template="navbar.cfm"> </div> <div id="content"> <fieldset> <cfinclude template="b2b_add_device.cfm"> <cfabort> </fieldset> </div> </div>
您可以在下面的代碼段中查看以下內容:
#wrapper { position:relative; margin-top:0; top:0; } #content { margin-left:250px; background-color: white; } #sidebar { float: left; width: 250px; background-color: #FFA; } #cleared { clear: both; } body { font: 11px 'Trebuchet MS'; color: #404040; } fieldset, legend { margin:0; padding:0; width:100%; height:100%; top:0; }
<div id="wrapper"> <div id="sidebar"><cfinclude template="navbar.cfm"></div> <div id="content"> <fieldset> <cfinclude template="b2b_add_device.cfm"> <cfabort> </fieldset>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.