Copyright © tutorialspoint.com
The max-height property is used to set an upper bound on the height of an element.
All the HTML elements except non-replaced inline elements and table elements.
object.style.maxHeight="50px" |
Here is the example:
<p style="width:400px; max-height:10px;border:1px solid red; padding:5px; margin:10px;"> This paragraph is 400px wide and max height is 10px This paragraph is 400px wide and max height is 10px This paragraph is 400px wide and max height is 10px This paragraph is 400px wide and max height is 10px </p> <img alt="logo" src="/images/css.gif" width="95" height="84" /> |
This will produce following result:
This paragraph is 400px wide and max height is 10px This paragraph is 400px wide and max height is 10px This paragraph is 400px wide and max height is 10px This paragraph is 400px wide and max height is 10px ![]() |
To Become more comfortable - Do Online Practice
Copyright © tutorialspoint.com