正しいfloat解除の仕方なのでしょうか?

<div style=”clear: both;”></div>←これは正しいfloat解除の仕方なのでしょうか?

divの中に何も入ってないのは少し違和感あります。
他の方法で、どのブラウザにも対応されてるfloatの解除の仕方はあるのでしょうか?

その<div>の後ろに続く要素にclearを付ければいいんじゃないでしょうか?
考え方を変えて、そのdivの中に、後に続く要素を取り込んでしまう、とか。

<hr>につけて非表示にするとか。

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny