728x90

100%

  • gives the element 100% height of its parent container.#innerDiv is going to have height: 50px
  • <div style="height: 50px"> <div id="innerDiv" style="height: 100%"></div> </div>

auto

  • means the element height will depend upon the height of its children.#innerDiv is going to have height: 10px
  • <div style="height: 50px"> <div id="innerDiv" style="height: auto"> <div id="evenInner" style="height: 10px"></div> </div> </div>

inherit

  • inherit the height value from it's parent.
    • absolute value inherit#innerDiv is going to have height: 50px;
    • <div style="height: 50px"> <div id="innerDiv" style="height: inherit"> <div id="evenInner" style="height: 10px"> </div> </div> </div>
    • relative value inherit#innerDiv is going to have height : 50%; (= 25% of page height)
    • <div style="height: 50%"> <div id="innerDiv" style="height: inherit"> <div id="evenInner" style="height: 10px"> </div> </div> </div>

'CSS' 카테고리의 다른 글

transform / transform-origin  (0) 2020.12.08
7. 위치 속성 CSS - Flex  (0) 2020.12.01
6. 위치 속성 CSS - 정렬  (0) 2020.12.01
5. CSS 위치 속성 - float, clear, overflow  (0) 2020.11.30
4. 위치 속성 정보 - position  (0) 2020.11.25

+ Recent posts