I have a div (div1) that has its position, width, height, everything all set, and it is set externally, so I can't know ahead of time what those values are.
Inside and at the top of div1 is another div (div2). I want div2 to float on the right of div1 without affecting the following information in div1.
I can add the attribute position:absolute and get div2 to float and not affect the contents, however, I cannot get it to float on the right, even when applying float:right.
If I understand correctly:
First, apply position: relative to your div1.
As it "won't work" when you have both float: right and position: absolute on your div2, you should replace the float: right rule with right: 0.
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