两列布局,右列扩展以填充窗口

时间:2014-07-13 16:14:43

标签: css

如果在绝对定位时我可以在CSS中使section流畅吗?

<div class="layout">
  <aside>leftnav</aside>
  <section>content fluid here</content>
</div>

aside {
   width: 200px;
   position: absolute;
   left: 0;
   top: 0;
}

section {
   position: absolute;
   top: 0;
   left: 200px;
   //fluid width to fill window
}

1 个答案:

答案 0 :(得分:0)

编辑:使用绝对定位,只需添加:

section {
    position: absolute;
    top: 0;
    left: 200px;
    right: 0px; // this line
}

编辑结束。

float代码上使用aside并向margin-left添加section

aside {
    width: 200px;
    float: left;
}

section {
    margin-left: 200px;
}