Home
CSS
CSS Height/Width
Tryit: Using max-width and min-width
Run ❯
Get your
own
website
Result Size:
625 x 534
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <head> <style> div { max-width: 400px; min-width: 100px; background-color: powderblue; } </style> </head> <body> <h2>Set the max-width and min-width of an element</h2> <p>Resize the browser window to see the effect.</p> <div>This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.</div> </body> </html>