作者xacid ( )
看板Web_Design
标题Re: [问题] 关於css的区块问题
时间Tue Jun 20 12:08:32 2006
我想到的是直接用绝对定位排。以这样的 html 为例:
<div id="main">
<div id="left">...</div>
<div id="right">...</div>
</div>
把 #left 设成 position: absolute ,然後设定上下距都是 0 就行了,像这样:
#main{
position: relative;
margin: 0 auto 0 auto;
width: 780px;
}
#left{
position: absolute;
width: 180px;
top:0; bottom:0;
background-color: #168;
color:#fff;
padding: 10px;
}
#right{
margin-left: 200px;
padding: 10px;
line-height: 1.5em;
background-color: #eee;
}
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.251.41
※ 编辑: xacid 来自: 140.112.251.41 (06/20 12:09)