基本上我的html代码看起来像这样:
<div id="leftbar"></div>
<div id="content"></div>
<div id="rightbar"></div>我如何用css编码,使所有3个div将并排,左栏和右栏有一个固定的宽度,而内容将是灵活的,以填充网页浏览器。
发布于 2010-01-22 12:07:26
发布于 2010-01-22 12:06:14
将左侧栏向左浮动,并为内容提供等于(或大于)左侧栏宽度的左边距值。将右侧栏向右浮动,并为内容提供等于(或大于)右侧栏宽度的边距-右侧值。
.nav1 { width:200px; float:left; }
.nav2 { width:200px; float:right; }
.content { margin:0 210px; }
.clear { clear:both; }--
<div id="wrapper">
<div class="nav1">Main Nav Items</div>
<div class="nav2">Other Nav Items</div>
<div class="content">Content goes here</div>
<div class="clear"></div>
</div>发布于 2012-09-01 15:29:14
https://stackoverflow.com/questions/2114854
复制相似问题