How do you float elements without a vertical gap?

后端 未结 9 2007
野的像风
野的像风 2020-11-30 16:03

I am trying to float elements left. Here is my css:

width: 320px;
float: left;
border: 1px solid #ccc;
margin-top: 10px;
margin-right: 10px;
border-radius: 5         


        
9条回答
  •  南笙
    南笙 (楼主)
    2020-11-30 16:26

    As div height is alter you must have the problem with floating like you're having. To solve you must use positioning techniques or you may just use margin-top in negative value for your third div.

    Alternatively, you should change the markup you're having something like this:

    div one
    div three
    div two

    And then you can manage the css easily...

提交回复
热议问题