K
K
keche2017-05-20 20:40:38
css
keche, 2017-05-20 20:40:38

Why doesn't Float allow the height of a block to be extended?

There is a block, it has two elements: a picture and p with text.
The main block has a background color set, the height is not set (so that the background of the block and the background stretch in height)
If these blocks follow each other by default. Then I put as much text as I like in the paragraph, the background of the main block is stretched.
However, if you add a float to the image so that the text wraps around the image, the background immediately disappears and the block is stretched in height, only without the background.
How to avoid it? To make the background stretch with the block, even when using Float?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alvvi, 2017-05-20
@alvvi

What to read ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question