Not Found
Your session has expired please log in again.
Your session has expired please log in again.
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Responsive Product Preview Card WebPage

@GodoiTheCreator

Desktop design screenshot for the Product preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

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

Tobennaβ€’ 610

@tobezhanabi

Posted

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 case

Here 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 helpful

1

@GodoiTheCreator

Posted

@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
Tobennaβ€’ 610

@tobezhanabi

Posted

@GodoiTheCreator you welcome and we all learning

1

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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