代码改变世界

三列自适应高且中列宽度自适应(P)

2011-07-28 00:30  科斌  阅读(182)  评论(0编辑  收藏  举报

<html>

<head>

<title>三列自适应高且中列宽度自适应(P)</title>

<style>

.wrap{

overflow:hidden;

}

.left{

width:240px;

background:yellow;

float:left;

}

.right{

width:240px;

background:green;

float:right;

}

.center{

background:#f00;

overflow:auto;/*原来这样还可以清除浮动啊*/

_float:left;/*话说又是留给ie6的*/

}

.row{

padding-bottom:10000px;

margin-bottom:-10000px;

}

</style>

</head>

<body>

<div class="warp">

<div class="left row">

<h3>左侧边栏</h3>

<ul><li>text</li><li>text</li><li>text</li></ul>

</div>

<div class="right row">

<h3>右侧边栏</h3>

<ul><li>text</li><li>text</li><li>text</li></ul>

</div>

<div class="center row">

<h3>中间栏</h3>

<ul><li>text</li><li>text</li><li>text</li></ul>

<span style="float:right;position:relative"></span>

<!--话说这个是留给IE6用的,不知道为什么-->

</div>

</div>

</body>