Two divs side by side - Fluid display

后端 未结 8 986
你的背包
你的背包 2020-11-22 03:09

I am trying to place two divs side by side and using the following CSS for it.

#left {
  float: left;
  width: 65%;
          


        
相关标签:
8条回答
  • 2020-11-22 03:51

    This is easy with a flexbox:

    #wrapper {
      display: flex;
    }
    
    #left {
      flex: 0 0 65%;
    }
    
    #right {
      flex: 1;
    }
    <div id="wrapper">
      <div id="left">Left side div</div>
      <div id="right">Right side div</div>
    </div>

    0 讨论(0)
  • 2020-11-22 03:51

    #sides{
    margin:0;
    }
    #left{
    float:left;
    width:75%;
    overflow:hidden;
    }
    #right{
    float:left;
    width:25%;
    overflow:hidden;
    } 
    <h1 id="left">Left Side</h1>
    <h1 id="right">Right Side</h1>
    <!-- It Works!-->

    0 讨论(0)
提交回复
热议问题