I'm trying to float an element to the right, and this element is inside a div
with no set size. The problem is that when you float the element p
to div
does not accompany the content.
Follow the HTML code:
<div id="divPrincipal">
<p>Conteúdo dentro da div</p>
</div>
And the CSS:
#divPrincipal{
border: 1px solid red;
}
#divPrincipal p{
border: 1px solid blue;
float: right;
}
How to solve this?