How to get these two divs side-by-side?

前端 未结 8 945
無奈伤痛
無奈伤痛 2020-11-27 14:28

I have two divs that are not nested, one below the other. They are both within one parent div, and this parent div repeats itself. So essentially:

8条回答
  •  长情又很酷
    2020-11-27 15:14

    #parent_div_1, #parent_div_2, #parent_div_3 {
      width: 100px;
      height: 100px;
      border: 1px solid red;
      margin-right: 10px;
      float: left;
    }
    .child_div_1 {
      float: left;
      margin-right: 5px;
    }
    

    Check working example at http://jsfiddle.net/c6242/1/

提交回复
热议问题