Why does:
width: 98%;
max-width: 1140px;
do the same as
width: 1140px;
max-width: 98%;
The first one make
If you set a fixed width
and a max-width
, this means the following:
If the width goes above max-width
, keep it at max-width
.
If the width is below max-width
, keep it on width
.
It will never go over the max-width
, that doesn't mean it can't stay under, the max
keyword obviously indicates a limit and not a rule.