0
I would like to know, which forms you use when you need an element to occupy the total WIDTH+HEIGHT that it is using, for example:
<p>
<span>Teste</span>
</p>
So that the P occupy the total size you are using, I usually use a class called cb, with the following properties:
.cb {
clear: both;
overflow: hidden;
}
or clearfix itself, however, I always wonder if there is a more organized way to do.
I don’t understand your question, the element
<p>
is already a block element, and so already assumes the entire size of its content (width + height)– Kazzkiq
I think the example was not very clear, but for example, if I had 2 SPAN’s inside P, and that float: left; in the same, the elements that came after P, would probably be in the same line as SPAN’s. To avoid this, I would use the CB class in the P.
– helderburato
Only the
overflow: hidden
that’s enough.– bfavaretto