CSS min-width property
Sometimes it's useful to constrain the size of an element in CSS to a certain range. The min-width
property limits how much an element can shrink horizontally. Practically, it means that if you set the min-width
of an element to 400px, it won't shrink smaller than that even on smaller screens, even if there's no content.
Pro Tip: The min-width
overrides the width
and max-width
properties. The width can't be smaller than the min-width
value, and if the min-width
value is greater than max-width
, the min-width
value is applied.