Design comparison
SolutionDesign
Solution retrospective
is it better to use the image as an HTML element or make an element and give it a background image using CSS
Community feedback
- @Danii215Posted over 1 year ago
since the image is different for mobile and for desktop (responsive design), the better option would be a picture tag (which has an img inside it):
https://www.w3schools.com/tags/tag_picture.asp
other than that, this article probably can help you decide between an img and a background-image:
https://www.w3docs.com/snippets/html/when-to-use-html-img-tag-and-css-background-image-property.html
1
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord