Reference: min-height sets the minimum height of the element. Can you explain what this property affects? If the narrow screen is smaller than the specified value, nothing happens visually. Explain, please.

  • one
  • @ soledar10 let's not give links to outdated resources, webref.ru/css/min-height - andreymal
  • so what. Set this picture (in the example by reference) min-height: 80 px, compress the screen to 50 and nothing happens. So what? - Proshka

2 answers 2

Suppose you have a series of images on your page, you set the height to them height: auto; and a limit of at least 40px min-height: 40px; and all images if they are of different heights will be of different heights, but with a limit of at least 40px.

If you need to set a percentage height restriction, then in this case the height of the parent block must be specified explicitly.

This property is not an explicit height specification, but a height restriction. This property can be applied to blocks, inline blocks.

  • And thank you very much! - Proshka

If you take interest, you need to take it from something. either write down:

body, html{height:100%} 

Or specify the same in the parent element:

 body.style_body { height:100%} 

Then min-height works great.