F
F
First name Last name2015-10-17 18:54:28
css
First name Last name, 2015-10-17 18:54:28

How to stretch a div 100% to display height?

Hello.
Can you please tell me how to stretch a div by 100% according to the height of the display from which the user entered? It is the height of the display and not the height of the page. This is usually done on various landing pages. The first screen per page is rubbed tightly to the bottom of the display. Is it possible to do this without JS? If not, how is it done by scripts?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
Denis Ineshin, 2015-10-17
@nickname-none

viewport units

S
Sergey Goryachev, 2015-10-17
@webirus

html, body { height: 100%; }
.block { height: 100%; }

The logic is simple, the height can be set as a percentage, if all parent from html to the block itself set the height in%.

D
dk-web, 2015-10-17
@dk-web

100vh?

F
First name Last name, 2015-10-17
@nickname-none

Thanks for the help. Here is another article in Russian on vw / vh.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question