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; } 

      效果图:

      

      

  • 相关阅读:
    【bzoj1196】[HNOI2006]公路修建问题
    【bzoj1082】栅栏[SCOI2005]
    【bzoj1012】[JSOI2008]最大数maxnumber
    【bzoj2330】 [SCOI2011]糖果
    【bzoj1008】[HNOI2008]越狱
    【bzoj1002】 [FJOI2007]轮状病毒DP
    【bzoj1001】[BeiJing2006]狼抓兔子
    C++-POJ2234-Matches Game[Nim][SG函数]
    C++-POJ1067-取石子游戏
    lodash常用
  • 原文地址:https://www.cnblogs.com/Sabo-dudu/p/7162247.html
Copyright © 2011-2022 走看看