Using :after to clear floating elements

后端 未结 5 925
失恋的感觉
失恋的感觉 2020-11-29 19:57

I have a list and the li\'s have a float:left;. The contents after the

    should be aligned correctly. Therefore i can build the following:
5条回答
  •  有刺的猬
    2020-11-29 20:47

    Write like this:

    .wrapper:after {
        content: '';
        display: block;
        clear: both;
    }
    

    Check this http://jsfiddle.net/EyNnk/1/

提交回复
热议问题