When would you use max-width instead of width on a responsive container?

  • To ensure a minimum width for the container
  • To make the container expand to its content width
  • To set a fixed width that does not change
  • To set a maximum width that adapts to the viewport
Using max-width in a responsive container allows it to adapt to smaller screens while capping the width at a specified maximum. This is particularly useful when designing layouts that need to be flexible but should not exceed a certain width, preventing horizontal scrolling on smaller devices.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *