Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted almost 3 years ago

Product Preview Card Component

rykryslr•100
@chigyong
A solution to the Product preview card component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Feedback and Comments for my improvement are well appreciated :)

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Lucas 👾•104,160
    @correlucas
    Posted almost 3 years ago

    👾Hello Rykryslr, Congratulations on completing this challenge!

    I saw your solution preview site and I think its already really good. Here’s some tips for you to improve it:

    1.Improve the card overall look adding the rounded borders to the component and also the image using border-radius: 15px

    • Add rounded borders to the left side of the image with border-radius: 15px 0px 0px 15px;
    • Then do the same thing for the component but in the opposite borders border-radius: 0px 15px 15px 0px;

    2.THE PICTURE TAG is a shortcut to deal with the multiple images in this challenge. So you can use the <picture> tag instead of importing this as an <img> or using a div with background-image. Use it to place the images and make the change between mobile and desktop, instead of using a div or img and set the change in the css with display: none with the tag picture is more practical and easy. Note that for SEO / search engine reasons isn’t a better practice import this product image with CSS since this will make harder to the image be found. Manage both images inside the <picture> tag and use the html to code to set when the images should change setting the device max-width depending of the device desktop + mobile.

    • Check the link for the official documentation for <picture> in W3 SCHOOLS: https://www.w3schools.com/tags/tag_picture.asp

    ✌️ I hope this helps you and happy coding!

  • Laharl•1,000
    @UrbanskiDev
    Posted almost 3 years ago

    Hello rykryslr !

    Congratulation for finishing this challenge

    I have some advice to give you :

    1. I recommend you to use the latest HTML semantic available, using <main> instead of a div with a class container. I give you a link to learn more about the latest HTML semantic !
    • W3Schools HTML5 Semantic
    1. In your HTML file, you put multiple <h1> tag in your page, which is not recommended the way you used it.

    You can remove the <h1> you added for the price, and then add CSS to make your layout.

    In the same idea, don't use <h5> before using an <h2>, <h3>, <h4>, if you want it to looks like it, use CSS. HTML is for structuring the page while CSS is for giving styles to your page.

    1. Still in your HTML file, you used a lot of <br> tags, while it is not a bad practice, it is not what I would recommend ! I'll recommend you to use CSS to make it looks like you did but without using <br> tag.

    I put a link which explain why it's not really used :

    • StackOverflow br tag

    I hope it helps you, keep learning and happy coding !

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

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit all CSS, SCSS and Less files in your repository.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

How does the JavaScript validation report work?

When a solution is submitted, we use eslint to run an automated check on the JavaScript code.

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub