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.
Loading...
Related Quiz
- In a flex container, how does the justify-content property affect the items?
- How can the @font-face rule be used in CSS?
- When creating a gradient, what does the 'angle' parameter in a linear-gradient function define?
- For performance considerations, which CSS function can be used to move an element on the Z-axis without triggering layout or paint operations?
- How does setting align-items: baseline; in a Flexbox container affect its items?