Image not resizing
I could resize an image in any way I wanted, but as soon as i added alt text, the image resized itself to its default size and i couldn't make it smaller no matter what.



6 Replies
Here's what happens when i remove the alt text

your image is missing a source
no source means an error which will display the alt text
if you absolutely must do this with a background image, use a transparent svg image as the source
something like
data:image/svg+xml,%3Csvg%20width=1%20height=1/%3E
if that doesn't work, replace %20
with a space
if that still doesn't work, add single quotes around the 1
or use picture element if you need to change the image based on the viewport size
well, the image is supposed to change when the screen is larger, so i set it through
content
in css
i'm playing around with it and i now removed the img and added content
to the section and i seems to work just fine
the only problem is the img is not proportional anymore
tho i just realized i don't have alt text anymore
that works!
Thank you guys, i appreciate your help :thanks:picture is the right element
by the way, you can use webp instead of jpeg, to save on bandwidth
thank you for the advice