Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>CSS Set Minimum Width of an Element</title> <style> div { width: 200px; min-width: 300px; background: #bbb3ff; } p { float: left; min-width: 400px; background: #eee8aa; } </style> </head> <body> <div>The minimum width of this div element is set to 300px, so it can't be narrower than that.</div> <p>Enter some text to see how it works.</p> </body> </html>