Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the document</title> <style> div { max-width: 250px; background-color: #8ebf42; } p { max-width: 20em; background-color: #ccc; color: #fff; } </style> </head> <body> <h2>Max-width property example</h2> <div>The max-width of this div element is defined as 250px.</div> <p>The max-width of this paragraph is defined as 20em.</p> </body> </html>