Junior JavaScript

What is the difference between min-width and max-width?

Property Description

min-wid

Element won’t shrink below this width

max-wid

Element won’t grow beyond this width

Example:

div {

min-width: 200px;

max-width: 600px;

Key Takeaway:

Use both for responsive, constrained resizing.

More from JavaScript Tutorial

All questions for this course