yeji

heigth:100% 본문

CSS

heigth:100%

yeji717 2020. 6. 9. 00:11

See the Pen wvMKoqr by yeji (@kimyeji) on CodePen.

 

 

 

height:100%를 쓰고 싶은데 안되서 px값을 주었더니 적용이 된다. height:100%값을 적용시키게 하려면 html,body에 height:100%를 줘야한다. 왜냐하면 div의 부모인 body나 html의 height가 auto로 되어있으므로 높이의 기준으로 서로를 삼기때문. (div가 100%로 이므로 body의 높이를 기준으로 해야하는데, body는 auto이므로 div의 높이를 기준으로 삼는다)

 

'CSS' 카테고리의 다른 글

IR기법  (0) 2021.02.23
CSS 가로 정렬? inline-block과 float중 어떤 것을 써야 할까?  (0) 2021.02.09
Flexbox  (0) 2021.01.30
display: table, table-cell / table-layout : fixed  (0) 2020.05.10
text-align : center / margin : 0 auto  (0) 2020.05.09
Comments