Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS: float: right does not expand container

Tags:

css

When I expand comment body that is floated to right my container does not expand with it. How can I fix this?

Better explanation: http://jsfiddle.net/5fmpp/

like image 634
Stan Avatar asked Jul 31 '11 15:07

Stan


People also ask

What to do if float right is not working?

The trick is to apply overflow: auto to the div , which starts a new block formatting context. The result is that the floated button is enclosed within the block area defined by the div tag. You can then add margins to the button if needed to adjust your styling.

How do I float a div to the right?

Use CSS property to set the height and width of div and use display property to place div in side-by-side format. float:left; This property is used for those elements(div) that will float on left side. float:right; This property is used for those elements(div) that will float on right side.

What is float right CSS?

The float CSS property places an element on the left or right side of its container, allowing text and inline elements to wrap around it. The element is removed from the normal flow of the page, though still remaining a part of the flow (in contrast to absolute positioning).


1 Answers

Check this out.

You need to clear the float at the end of the comment box

like image 132
Ahmad Alfy Avatar answered Sep 21 '22 11:09

Ahmad Alfy