Wrapper question when containing floating divs

后端 未结 4 1915
孤街浪徒
孤街浪徒 2021-01-05 19:00

I would like to create a, browser centered, bordered, wrapper that autoexpands in height around various divs. When using floats to keep the divs in-line, the wrapper just st

4条回答
  •  温柔的废话
    2021-01-05 19:34

    I would use the :after psuedo class like below. It seems a bit more obvious what is supposed to happen and a bit less like browser weirdness. I'm sure not that overflow solution is officially supposed to work.

    #wrapper:after {
        clear:both;
        display: block;
        content: " ";
    }
    

提交回复
热议问题