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
Not Found
Not Found
Not Found

Submitted

Product preview card component solution using HTML and CSS

@guidoghg

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


What's the easiest way to get a mobile version of the same webpage? I use @media (max-width: 600px) and put all the modification there, but I don't know if that is the most efficient way of doing it.

Community feedback

@VCarames

Posted

Hey there! 👋 Here are some suggestions to help improve your code:

  • To better identify the main content of you site you will want to encase your entire component inside a Main Element.

  • The Alt Tag Description for the image needs to be improved upon. You want to describe what the image is; they need to be readable. Assume you’re describing the image to someone.

  • This challenges requires the use of two images 🎑 for different breakpoints. The Picture Element will facilitate this.

Here is an example of how it works: EXAMPLE

Syntax:

  <picture>
    <source media="(min-width: )" srcset="">
    <img src="" alt="">
  </picture>

More Info:

https://www.w3schools.com/html/html_images_picture.asp

https://web.dev/learn/design/picture-element/

  • The only heading in this challenge is the name of the perfume, “Gabrielle Essence Eau De Parfum” . The rest of the text should be wrapped in a Paragraph Element.

If you have any questions or need further clarification, let me know.

Happy Coding! 👻🎃

1

@LovelyFaisal

Posted

Hi @guidoghg ! You've done great 💪

Here are some suggestions to improve your code:

  • You need to add the alt attribute to your image like this <img src="images/image-product-desktop.jpg" class="desktopProduct" alt="qr code to frontendmentor">

The required alt attribute provides an alternate text for an image, if the user for some reason cannot view it (because of slow connection, an error in the src attribute, or if the user uses a screen reader).

You can learn more here

  • Use <main> instead of a simple <div> this way you improve the semantics and accessibility showing which is the main block of content on this page. Remember that every page should have a <main> block and that <div> doesn't have any semantic meaning.

Click here for more information

Good job, and happy coding!

1

@guidoghg

Posted

@LovelyFaisal Thanks for the feedback, I replace alt with class without even realizing that it needs to stay there.

0

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