码迷,mamicode.com
首页 > 其他好文 > 详细

左栏固定,右栏自适应

时间:2018-01-27 00:31:24      阅读:174      评论:0      收藏:0      [点我收藏+]

标签:bsp   span   nbsp   back   适应   ack   blog   html   自适应   

方法1:

<style>

        body{ margin:0; height:100%}

        html{ height:100%} /*兼容firefox的div高度100%*/

        #left{ position:absolute; top:0; left:0; width:200px; height:100%; background-color:#CCCCCC}

        #right{ margin-left:200px; height:100%; background-color:#0099FF}

</style>

方法2:

<style>

        body{ margin:0; height:100%}

        html{ height:100%} /*兼容firefox的div高度100%*/

        #left{ width:150px; height:100%; float:left;  ">#right{ height:100%; background-color: green }

</style>

方法3:

<style>

        body{ margin:0; height:100%}

        html{ height:100%} /*兼容firefox的div高度100%*/

        #left{ width:200px; height:100%; background-color:#CCCCCC; float:left}

        #right{ width:100%; height:100%; background-color:#0099FF}

</style>

左栏固定,右栏自适应

标签:bsp   span   nbsp   back   适应   ack   blog   html   自适应   

原文地址:https://www.cnblogs.com/cdx0/p/css_twoPart.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!