I have a div that is float: right
and it is inside a parent div. There are p
elements inside that same parent div also, and the text wraps around the float: right
div properly.
However, if I set the p
elements to have a border, or do a <hr />
, the border does not stop where the text stops, but extends behind the float: right
div.
Here is a beautiful mspaint depiction of the situation:
Note that the green part of the black horizontal line is behind the floating div.
How do I get the border or <hr />
or whatever to be only as wide as the text, and not go behind the div?