What does the CSS rule “clear: both” do?

前端 未结 5 1531
轮回少年
轮回少年 2020-11-21 07:42

What does the following CSS rule do:

.clear { clear: both; }

And why do we need to use it?

5条回答
  •  无人及你
    2020-11-21 07:57

    CSS float and clear

    Sample Fiddle

    Just try to remove clear:both property from the div with class sample and see how it follows floating divs.

提交回复
热议问题