W
W
winbackgo2018-12-03 13:21:16
css
winbackgo, 2018-12-03 13:21:16

Why is the width of the container not taken into account if the child element does not have a width set?

We have two columns of fixed width and one that takes up the rest of the space. This is what happens if you insert content wider than the column. How to fix it?

It is necessary that it works in the same way as if you set the width.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
AlexKeller, 2018-12-03
@winbackgo

.main > .content
add rule
min-width: 0;
https://jsfiddle.net/z5eLt8w9/1/

A
Alexander, 2018-12-03
@smoyke

Why don't you want to set the size of the middle column?
If you have a left column of 120px, a right column of 240px, then you can set the middle one to width: calc(100% - 360px); and everything will be fine. And it is not necessary to insert blocks with a rigidly specified width into the "rubber" block, at least it is not logical, because it should shrink when resized.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question