Using the css heigh, min-height and max-height of

1, min-height and height simultaneously, who listen to whom large

2, max-height and height simultaneously, who listen to the small

3, height, min-heigth max-height, and simultaneously, into the following cases

  • height> max-height> min-height element height: max-height
  • height> min-height> max-height element height: min-height
  • min-height> height> max-height element height: min-height   
  • min-height> max-height> height element height: min-height 
  • max-height> height> min-height elements Height: height
  • max-height> min-height> height element height: min-height

We met before a usage scenario: when the whole page is absolutely positioned and has a background color, due from the document flow, so that the father of the box height of 0, if you set a specific fixed height, there will be adaptation problems on the mobile side, that is a different size phones height different background colors appear fault, if you use min-height and height, who is large who to listen to, min-height: 100%, height: fixed height (can be set to exactly the positioning height elements wrapped in), when the phone is highly large, min-height> height, a page full screen on a small phone screen, height> min-height, fit a screen, page scrolling, scroll bars, height height

Guess you like

Origin www.cnblogs.com/xldbk/p/12114686.html