Two divs side by side - Fluid display

后端 未结 8 1103
你的背包
你的背包 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:28

    You can also use the Grid View its also Responsive its something like this:

    #wrapper {
       width: auto;
        height: auto;
        box-sizing: border-box;
        display: grid;
        grid-auto-flow: row;
        grid-template-columns: repeat(6, 1fr);
    }
    
    #left{
        text-align: left;
        grid-column: 1/4;
    }
    
    #right {
        text-align: right;
        grid-column: 4/6;
    }
    

    and the HTML should look like this :

    ...some awesome stuff

    here is a link for more information:

    https://www.w3schools.com/css/css_rwd_grid.asp

    im quite new but i thougt i could share my little experience

提交回复
热议问题