How to place two divs next to each other?

后端 未结 13 2157
孤独总比滥情好
孤独总比滥情好 2020-11-22 05:44

Consider the following code:

13条回答
  •  深忆病人
    2020-11-22 06:21

    My approach:

    Left
    Right

    CSS:

    .left {
        float: left;
        width: calc(100% - 200px);
        background: green;
    }
    
    .right {
        float: right;
        width: 200px;
        background: yellow;
    }
    

提交回复
热议问题