How to make an empty div take space

前端 未结 12 1674
广开言路
广开言路 2020-12-12 13:03

This is my 960 grid system case:

ID
12条回答
  •  抹茶落季
    2020-12-12 13:30

    With using the inline-block it will behave as an inline object. so no floats needed to get them next to eachother on one line. And indeed as Rito said, floats need a "body", like they need dimensions.

    I totally agree with Pekka about using tables. Everybody that build layouts using div's avoid tables like it's a desease. But use them for tablular data! That's what they're ment for. And in your case i think you need them :)

    BUT if you really really want what you want. There is a css hack way. Same as the float hack.

    .kundregister_grid_1:after {  content: ".";  }
    

    Add that one and you're also set :D (Note: does not work in IE, but that is fixable)

提交回复
热议问题