S
S
SnowElephant2014-05-18 17:32:58
css
SnowElephant, 2014-05-18 17:32:58

Overflow: auto without height/max-height

Example: codepen.io/anon/pen/AaLBu (remove height from .list)
It is necessary that for .list without an explicit height specification, overflow is triggered, which is limited by the parent container (i.e. take free space, then scroll).
This is necessary because there may be several more neighbors of the .title type nearby, but I don’t want to calculate the total height each time and subtract from 100%.
height: 100% thinks it should be injected just like height: inherit, while height: auto simply pushes the block out of the parent.
Maybe there are some tricks or is it possible with flexbox?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
SnowElephant, 2014-12-14
@SnowElephant

Sort of solved it: codepen.io/anon/pen/LENBea
Uses flexbox and new css3 width/height: fill-available
Only works in webkit with a prefix.

T
telegraphnij_stolb, 2014-05-18
@telegraphnij_stolb

You need to create a new block formatting context.
This can be done either with overflow: hidden or with overflow-x hidden. So in this case, you need to do for the container.
codepen.io/anon/pen/jECLF

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question