V
V
Vakov2018-08-09 14:46:24
css
Vakov, 2018-08-09 14:46:24

How to set a dynamic responsive block height using HTML + CSS?

There is a site with adaptive design, I want to make a block on it in the following form:
so that with a screen width of 360, the height of the block is 250px, the width is full screen.
with a screen width of 650, the block height was 450px, the width was full screen.
when changing the screen width from 650 to 360, so that the block height smoothly changes from 450px to 250px, for example, with a screen width of 600, the block height is approximately 410px.
When changing the screen width more than 650 - keep the height 450 and align the block to the center.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
�
ⓒⓢⓢ, 2018-08-09
@Vakov

(pseudocode):

margin: 0 auto;
height: 69vw;
min-height: 250px;
max-height: 450px;

A
Andrej Sharapov, 2018-08-09
@Madeas

Might help

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question