<img> / <picture> in HTML or bg-image in CSS ?

Should this big image be used as an <img> tag in HTML or as a background-image in CSS? What is the correct way? It is a big part of the design, but it seems only decorative to me. Can you help me decide?
No description
3 Replies
Jochem
Jochem2d ago
I'd personally probably use a background-image for that. You're right that it serves very little purpose past being decorative
Gümrah
GümrahOP2d ago
Thanks. I was thinking the same, so background-image makes sense
ἔρως
ἔρως22h ago
i will actually say the opposite: you could use a <figure> for this, with multiple sources for each screen size ive experimented with it recently, and, ... HOLY CRAP all my issues with using multiple sizes and stuff? gone! you can also take advantage of vastly superior formats like jpegxl, and use slightly inferior ones like avif and webp and also have jpeg for compatibility with older apple stuff you can just use jpegs, if you wish

Did you find this page helpful?