zoukankan      html  css  js  c++  java
  • 左右布局,左边定宽,右边自适应。

      左右布局,左边固定宽度,右边自适应。

      自己整理的几种方法:

      页面布局如下:

      

      方法1: 左边定位,右边添加marge-left

      .div1{  300px; height: 600px; background: black; position: absolute;

      .div2{height: 600px; min- 100px; background: red; margin-left: 300px} 

      方法2: 左边定为,右边定位(设置left)

      .div1{  300px; height: 600px; background: black; position: absolute;} 

      .div2{height: 600px; min- 100px; background: red; position: absolute; left: 300px; } 

      方法3:左边浮动 右边浮动(右边width设置为calc(100% - 300px); 必须有空格)

      .div1{  300px; height: 600px; background: black; float: left; } 

      .div2{height: 600px;  calc(100% - 300px); background: red; float: left; } 

      方法4: 左边浮动 右边设置overflow:auto

      .div1{  300px; height: 600px; background: black; float: left; } 

      .div2{ height: 600px; min- 200px; background: red; overflow: auto; } 

      方法5: 左边浮动 右边添加 marge-left

      .div1{  300px; height: 600px; background: black; float: left; } 

      .div2{ height: 600px; min- 200px; background: red; marge-left:300px; } 

      效果图:

      

      

  • 相关阅读:
    Javascript继承,再谈
    RHEL7使用systemctl管理服务
    centos7进入单用户模式修改root密码
    IBM DS5020 管理口密码重置
    IBM小机拆镜像换盘
    HMC版本支持
    IBM产品系列和AIX系统版本
    AIX 6.1创建逻辑卷并挂载【smitty】
    AIX中的网络管理
    创建AIX克隆盘
  • 原文地址:https://www.cnblogs.com/Sabo-dudu/p/7162247.html
Copyright © 2011-2022 走看看