Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Example of CSS max-height property</title> <style> p { max-height: 100px; background: #ffc0cb; } div { height: 200px; max-height: 100px; background: #f0e68c; } </style> </head> <body> <p>Enter some more line of text to see how it works.</p> <div>The maximum height of this div element is set to 100px, so it can't be taller than that.</div> </body> </html>