How to place two divs next to each other?

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

Consider the following code:

13条回答
  •  醉梦人生
    2020-11-22 06:15

    This is the right CSS3 answer. Hope this helps you somehow now :D I really recommend you to read the book: https://www.amazon.com/Book-CSS3-Developers-Future-Design/dp/1593272863 Actually I have made this solution from reading this book now. :D

    #wrapper{
      display: flex;
      flex-direction: row;
      border: 1px solid black;
    }
    #first{
      width: 300px;
      border: 1px solid red;
    }
    #second{
      border: 1px solid green;
    }
    Stack Overflow is for professional and enthusiast programmers, people who write code because they love it.
    When you post a new question, other users will almost immediately see it and try to provide good answers. This often happens in a matter of minutes, so be sure to check back frequently when your question is still new for the best response.

提交回复
热议问题