@sqle157
Posted
Hi,
Congratulations on completing your challenge! For your question, you can try to use min
in your width so that it will change the width base on the smaller value.
For example, your css can be like this
.container {
width: min(100% - 1.5rem, 450px ) // This will make the width of the container equals the width of the
parent width minus 1.5rem on each side and it will apply when the screen is small
This is a common way to define a container that wraps around all the content.
I hope this answers your question, and have a nice day!
Marked as helpful
@evanhill1989
Posted
@sqle157
Ah cool approach. Much more precise than what I had. Thank you so much!