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: relativeto yourdiv1.As it “won’t work” when you have both
float: rightandposition: absoluteon yourdiv2, you should replace thefloat: rightrule withright: 0.