max-width is the king of width?
Just get to know the max-width will override the width with !important. So is any other CSS settings have such high override property? It's a trap for a junior developer.
2 Replies
Its that min/max-width will be the "max" or "min" width so both can override*. Fun fact is if there is no content you have to have a width/height to make the box but then can set min/max on it.
Typically using important and set widths and heights are what trap people.
https://codepen.io/b1mind/pen/JjveXPd
Also min would be the "king" 🤔
min override the max, min is king and max is queen😆