K
K
Kirill Gladikov2016-04-02 15:09:49
css
Kirill Gladikov, 2016-04-02 15:09:49

How to make a square, rubbery div?

How to make it so that when the width of the block decreases, the height decreases by the same number of pixels (the block is always square) ? The Vh and Vw units are not suitable due to poor support and a scrollbar bug. I know about the method with JS and spacer using a transparent image. Are there any other methods???

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Serj-One, 2016-04-02
@Fapalz

codepen.io/Serj-One/pen/XdKxEB - jQ
codepen.io/Serj-One/pen/grMBdr - without js, but with extra wrappers.

B
bogdan0083, 2016-04-02
@bogdan0083

www.wmyl.se/en/blog/proportional-scaling-responsiv...
Example: jsfiddle.net/4E2bV/1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question