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 challenge 5

@Teddyness

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


Continuing after a long time

Community feedback

Hassia Issah 50,670

@Hassiai

Posted

Replace<h6> with <p>, <h5> with <p> and <div class="attribution"> with the footer tag to fix the accessibility issues. for more on semantic html visit https://web.dev/learn/html/semantic-html/

In the desktop design, give the main a fixed width value instead of a percentage: e.g: main{width: 600px}

Use rem or em as unit for the padding, margin, width and preferably rem for the font-size for more on CSS units watch this https://youtu.be/N5wpD9Ov_To

Hope am helpful

Well done for completing this challenge. HAPPY CODING

0

@VCarames

Posted

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

  • A lot of the headaches and repeated properties can be be overcome by implementing a proper CSS Reset.

Here are few CSS Resets that you can look at and use to create your own or just copy and paste one that is already prebuilt.

https://www.joshwcomeau.com/css/custom-css-reset/

https://meyerweb.com/eric/tools/css/reset/

http://html5doctor.com/html-5-reset-stylesheet/

  • Implement a Mobile First approach 📱 > 🖥

With mobile devices being the predominant way that people view websites/content. It is more crucial than ever to ensure that your website/content looks presentable on all mobile devices. To achieve this, you start building your website/content for smaller screen first and then adjust your content for larger screens.

More Info:📚

Mobile First

  • For improved accessibility for your content, it is best practice to use rem for your font-size and em for media-queries. Using these units gives users the ability to scale elements up and down, relative to a set value.
  • Since the images in this component add value and serve a purpose (displaying the product) it needs to be accessible. The image needs to be applied using the picture element and not the background-image property, as it will not only let you use different images during different breakpoints it will let apply an alt tag description to image stating what the image is.

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

  • Do not capitalize "perfume" in HTML as it is not accessible friendly. Instead you will want to style it in CSS.
  • The only heading in this component, 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, feel free to reach out to me.

Happy Coding!🎄🎁

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