I have an element in a div set to float: right
however, it causes the outermost div not to wrap around. This is jsfiddle for it.
I'm trying to get the submit button to float right within the div but setting that attribute seems to cause it to break. How can I get a parent element to wrap a floated element?
Set the container to overflow: hidden
, and it'll wrap!
I figured it out. The parent div should have overflow: hidden;
. That will make it contain any floated elements in it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With