@jaspervo91
Posted
Neat code!
You can use the max-width
property to set the maximum width of an element.
The problem with the <main>
container and <img>
element occurs when the browser window is smaller than the width of the element (320px and 288px respectively). The browser then adds a horizontal scrollbar to the page.
Using max-width
instead, will improve the browser's handling of small windows.
For example:
img {
max-width: 288px; /* or 100% */
height: auto;
border-radius: 16px;
}
Marked as helpful