How to place two divs next to each other?

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

Consider the following code:

13条回答
  •  粉色の甜心
    2020-11-22 06:29

    You can sit elements next to each other by using the CSS float property:

    #first {
    float: left;
    }
    #second {
    float: left;
    }
    

    You'd need to make sure that the wrapper div allows for the floating in terms of width, and margins etc are set correctly.

提交回复
热议问题