hi there! 👋
You didn't mention what was the purpose of using max-width
in the first place. So what was the expected behavior and what happened instead.
I usually use max-width
with the combination of the width
property using relative units. It works perfectly fine when I use it.
Example:
.element {
width: 90%;
max-width: 650px;
margin: 0 auto;
}
Here .element
will take up 90% of the viewport width, but it will stop at 650px and won't expand anymore.
Hope this was helpful 🙏
Good luck and happy coding! 💪
Marked as helpful