How to place two divs next to each other?

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

Consider the following code:

13条回答
  •  故里飘歌
    2020-11-22 06:23

    Try to use flexbox model. It is easy and short to write.

    Live Jsfiddle

    CSS:

    #wrapper {
      display: flex;
      border: 1px solid black;
    }
    #first {
        border: 1px solid red;
    }
    #second {
        border: 1px solid green;
    }
    

    default direction is row. So, it aligns next to each other inside the #wrapper. But it is not supported IE9 or less than that versions

提交回复
热议问题