ReactJS: How to make <div/> float not affect the next <div/>?
15,370
Solution 1
You should clear the last div. Try this:
<div style={{clear:'both'}}>Below</div>
Solution 2
Have you tried clearing that last div?
clear: both
Author by
Jo Ko
Updated on June 10, 2022Comments
-
Jo Ko about 2 years
I currently have:
<div style={{float:'left'}}>Left</div> <div style={{float:'right'}}>Right</div> <div>Below</div>
I was able to get
Left
andRight
to be on the opposite ends like intended on the same line, but theBelow
is also affected, and floats to the left, right next toLeft
, even though float has not been defined for it.So I was wondering how to keep
Below
on the next line, without being affected by the previous floats?