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

      效果图:

      

      

  • 相关阅读:
    UVa 11300 Spreading the Wealth(有钱同使)
    hihoCoder 1385 : A Simple Job(简单工作)
    hihoCoder 1383 : The Book List(书目表)
    HDU 5724 Chess(国际象棋)
    Sobytiynyy Proyekt Casino Gym
    Course recommendation Gym
    Poor Folk Gym
    How far away? (HDU
    BAPC 2016 ----Brexit (BFS + vector)
    Simpsons’ Hidden Talents(扩展KMP)
  • 原文地址:https://www.cnblogs.com/Sabo-dudu/p/7162247.html
Copyright © 2011-2022 走看看