C
C
Cepesh162019-05-11 20:14:46
css
Cepesh16, 2019-05-11 20:14:46

Why is overflow:hidden; doesn't hide the text next to the float block?

As far as I understand overflow: hidden; hides all the content that crawls out of the block /
In my case with float, it does not hide the text on the left, but simply shifts it down the width of the block in which it is located:
5cd700dc60a6b210802782.png
Why isn't he hiding?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey delphinpro, 2019-05-11
@Cepesh16

There are the concepts of the flow of elements in a document and the formatting context . Lowercase are arranged in the stream from left to right, block - from top to bottom. Float causes other elements in the stream to flow around the specified one. This is exactly what you see in the first example.
Certain properties create a new context (overflow, display with some values, and others). The new context creates its own stream of elements. You see it in the second example.

S
Shohruh Shaimardonov, 2019-05-11
@joeberetta

It will work if you set the bottom margin:

.float-left {
  margin-bottom: 70px /* = 100px - 30px (высота родительского блока - высота блока .float-left) */
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question