If a div has “clear:right”, nothing should float to the right of it, should it?

前端 未结 5 1858
暗喜
暗喜 2021-02-15 11:04

I seem to have gotten confused as to what the css \"clear\" keyword means.

I have a number of div elements, all with \"float:left\". The second last div element also has

5条回答
  •  囚心锁ツ
    2021-02-15 11:53

    The clear property doesn't prevent elements from being placed in that space after the cleared element. It prevents the element from being placed where there are already elements floated to the that direction before it. Adding a clear:left to div.Duration would make it be placed below the navy box. Adding a
    before the duration might solve your problem, or, as you already said in your question, you could use another container div for the last three divs.

提交回复
热议问题