CSS: Floating multiple elements with different heights on multiple rows?

后端 未结 6 1228
既然无缘
既然无缘 2020-12-18 23:13

I\'m trying to organize divs into two columns, but not force them into rows. I\'m also trying to keep the vertical spacing between the divs a const

6条回答
  •  遥遥无期
    2020-12-18 23:51

    You can use table tag. Try something like this

    HTML

    CSS

    body {
      padding: 40px;
    }
    
    .module {
      height: 50px;
      width: 45%;
      margin-right: 3%;
      margin-bottom: 20px;
      background: yellow;
    }
    

    DEMO: http://jsfiddle.net/89mW6/5/

提交回复
热议问题