๋ฐ์ํ
[CSS] height: 100% / height: auto;
height: 100%;
- ๋ถ๋ชจ ์ปจํ ์ด๋์ ๋์ด๋ฅผ 100% ๋ก ์ค์ ํ๋ค. (๋ถ๋ชจ๋์ด ์ํฅ)
<div style="height: 50px">
<div id="innerDiv" style="height: 100%"></div>
</div>
#innerDiv
๋height: 50px
height: auto;
- ๋์ด๋ ์์์ ๋์ด์ ๋ฐ๋ผ ๋ฌ๋ผ์ง๋ค. (์์๋์ด ์ํฅ)
<div style="height: 50px">
<div id="innerDiv" style="height: auto">
<div id="evenInner" style="height: 10px"></div>
</div>
</div>
#innerDiv
๋height: 10px
Reference
https://stackoverflow.com/questions/15943009/difference-between-css-height-100-vs-height-auto
๋ฐ์ํ
'๐ฉ๐ปโ๐ปSTUDY > CSS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[CSS] CSS๋ฐฉ๋ฒ๋ก (BEM/OOCSS/SMACSS) (0) | 2020.09.11 |
---|---|
[CSS] padding position ์์ญ (0) | 2020.07.07 |
[CSS] opacity / visibility / display ์ฐจ์ด์ (0) | 2020.03.31 |
[CSS] ๋ฐ์ํ ์ด๋ฏธ์ง ๋ฃ๊ธฐ (0) | 2020.03.31 |
[CSS] @media query (0) | 2020.03.26 |