CSS side by side div with Pixel and Percent widths

后端 未结 7 994
半阙折子戏
半阙折子戏 2020-12-08 10:54

I have two div\'s (side by side) inside a parent div, i want right div to occupy 100% of remaining space (i.e. 100% - 200px) and should always stay next to left div (not bel

7条回答
  •  醉话见心
    2020-12-08 11:47

    If you want right div to have constant width:

     

    And CSS

     .wrapper{
         margin-right: CONSTANTpx;
     }
     .wrapper div{
         float:left;
     }
     .constant-width{
         top: 0px; right:0px; position:absolute;
         width: CONSTANTpx
     }
    

    Works good without borders

    JSFiddle

提交回复
热议问题