Responsive Product Preview Card WebPage
Design comparison
Solution retrospective
I would like to know if it's a correct way to change between images, when I want to specify what image I'll want to use to mobile or desktop, using display: none and display: block. I couldn't be able to use something like backgound-image property because it got always a blank space. If you have any other recomendations, I'll be gratefull.
Community feedback
- @tobezhanabiPosted over 1 year ago
Hi Godoi, You did a nice job working with an API. Congratulation on submitting a working task. ππ
Short answer yes, There is a more standard way to switch between images instead of creating a <div class= "imagem"> you could have used the default picture tag.
<picture> <source media="(min-width:850px)" srcset="img_pink.jpg"> <source media="(min-width:465px)" srcset="img_white_flower.jpg"> <img src="img_orange_flowers.jpg" alt="Flowers" style="width:auto;"> </picture>
You can even have 3 images for different screen size. You can use
(max-width)
for your own caseHere are a few other suggestions to the issue with your solution.
Work on HTML The landmark <div class="container"> should be replaced with <main> and also switch <div class="attribute"> with <footer>.
Landmarks in HTML are structural elements that define the major sections of a webpage. They include semantic elements such as <header>, <nav>, <main>, <article>, <aside>, and <footer>
Heading
Headings must be in a valid logical order, meaning h1 through h6 element tags must appear in a sequentially-descending order.
Hope you find this helpful
Happy Codingπ
Marked as helpful1@GodoiTheCreatorPosted over 1 year ago@tobezhanabi Thank you for the comment! I didn't know about this tag picture, it's very helpful. Also, thank you for the advice about name tags like main, etc, I'll try to improve my html in the next project! Thank you, again!
0
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