问题
I've been looking at this for the past days now and I'm at the point where I need to ask for help.
http://cub.northnodes.com/index.php/about/mission/
I need the donate now column to float all the way to the right, but it only goes halfway. I can't figure out why it's stopping there, there's no containing div that ends there. I've tried to take it out of the #center
div, and have placed it both before it with no better results. Placing it after the #center
div makes it float left all the way beautifully, but below the #center
where I don't want it to be.
回答1:
In case others come later:
I had a similar issue where float right would only move halfway across its containing div
. Neither it, its siblings, or container had position relative. However, the containing div
's prior sibling also had a child with a float: right;
(coincidence that it was the last child; not sure?). I solved my problem by adding a clear: both;
to the div
containing the offending floater. This was on Chrome.
回答2:
This happened to me because I had set max-width
on a parent container. I removed that and my element floated all the way to the right properly.
来源:https://stackoverflow.com/questions/5586061/floatright-not-floating-all-the-way-to-the-right