好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

常见的两列、三列布局,宽高自适应_html/css_WEB-ITnose

今天是猴年的第一天班,也是新的起点。分享一个如何用css实现我们在工作中常见的两列布局:1.左侧固定宽度,高度自适应右侧;2.左侧宽度高度固定,右侧自适应宽高;3.左侧、右侧固定宽,中间自适应。

1.左侧固定宽度,高度自适应右侧

效果图

pic1.png

pic2.png

html+css
     左侧固定宽,自适应右侧高度      .main{        position: relative;        color: #fff;    }    .left{        position: absolute;        top: 0;        left: 0;        bottom: 0;        width: 300px;        background: #f00;    }    .right{        height: 200px;        margin-left: 300px;        background: #000;    }   

left

查看更多关于常见的两列、三列布局,宽高自适应_html/css_WEB-ITnose的详细内容...

  阅读:33次