Keep in mind that by default, images in HTML behave as inline elements, meaning they are displayed within the flow of text and do not take up the full width of the page. If multiple images are placed next to each other, they will appear in the same line until there is no more space.
To have more control over the styling and layout of images, it is common to apply CSS rules to modify their behavior. like so:
img {
display: block;
width: 100%;
max-width: 100%;
}
display: block;: This rule changes the display property of images to "block". This makes the images behave like block elements, taking up the full width of their containing and allow you to use padding and margins.
width: 100%;: This rule sets the width of the image to 100% of its containing element's width. With this rule, the image will expand horizontally to fill the available space.
max-width: 100%;: This rule sets the maximum width of the image to 100% of its natural size. It ensures that the image will not exceed its original dimensions if the containing element becomes narrower than the image's natural width.