N
N
nomta2017-02-24 01:07:27
css
nomta, 2017-02-24 01:07:27

How to change block height dynamically?

How to specify the dimensions of the block when laying out with flexbox, so that, regardless of its content, the height dynamically changes along with the width, while maintaining proportions? Is there a "correct" way? I do this (sass):

div
    overflow: hidden
    &:before
        content: ''
        padding-top:  100%
        float: left

The problem is that this doesn't work in chrome.
Perhaps I want something that, by definition, should not be? Flexbox is a new topic for me and I suspect that they are simply not designed for this.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
profesor08, 2017-02-24
@profesor08

You here: https://benmarshall.me/responsive-iframes/
Do not look at the name, it is suitable for all blocks.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question