0

I have the next two elements in some rectangle view:

width:19%;
height: 20vh !important;

With the first element I save the width to be smaller every time I small the screen.

I can't use the same thing on the height, because the block I use it with is always changing its height, and just its width stays the same.

I thought something about:

width = "do 20% of what the height is"

And then I will be able to keep the exactly size of the rectangle in every size of the screen, (because the width will be always depends with the height - which depends on the width of the block they are in and which never changes.)

EDIT: It's not the exact question like suggested below.
The "duplicate" talks about a container that always stay the same. My container is different because the height is changed every time!

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
wef erv
  • 13
  • 3
  • Can you try something like this : `width : 4vh` and `height : 20vh`? – Pascal Goldbach Sep 06 '16 at 15:20
  • Tried this. i cant use it, because then its still big when i rezise just the width, and its not looking good with the rest of the page (which becoming small) – wef erv Sep 06 '16 at 15:41

0 Answers0