zl程序教程

您现在的位置是:首页 >  其他

当前栏目

关于三列布局中间列的居中问题

2023-03-14 10:22:19 时间

请看代码

<style type="text/css">
	body{ margin:0; padding:0}
	.left{ width:100px; background:#06F;float:left; height:100px;}
	.mid{background:#099; height:100px;}
	.right{ width:100px; background:#F00; float:right;height:100px;}	
</style>
<body>
<div class="left">1</div>
<div class="right">3</div>
<div class="mid">2</div>
</body>


中间列放最后,然后不给它浮动和宽度就可以了。