Templee_0412) Height : fit-content

오범준·2021년 4월 12일
0

2nd Team Project : Templee

목록 보기
12/12

Height : "fit-content" vs "vh"

height : 12vh 

< Mobile >

< DeskTop >

Why ?

Why is this happening ??

Because,
"VH" means,
you are setting the height based on
"browser"

regardless of the
height of parent
or
height of chidren contents

In this situation,
if you enlarge the browser ,
the children contens get enlarged also.

but, the wrapper , that wraps the entire content
is set to 'vh'

which means,
"height" does not enlarge,
unless the 'height' of the 'browser' you are seeing
does not change

Solution

height : fit-content

The fit-content behaves as fit-content(stretch). In practice this means that the box will use the available space, but never more than max-content.

profile
Dream of being "물빵개" ( Go abroad for Dance and Programming)

0개의 댓글