Languages
[Edit]
EN

CSS - set element max height

0 points
Created by:
elmer
646

In this article, we would like to show you how to set element max height using CSS.

Quick solution:

 

Practical example

Edit

In this example, we use max-height CSS property to set element maximum height to 100px. If the height property percentage value will be calculated to more than 100px, the max-height property will prevent the element from expanding vertically.

 

See also

Edit
  1. CSS - set element min height

References

Edit
  1. max-height - CSS: Cascading Style Sheets | MDN

Alternative titles

  1. CSS - set element maximum height
  2. CSS - set element maximal height
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join