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

Product Preview Card

Gwen•40
@gwencoding
A solution to the Product preview card component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


I use Html and Css only.

Being new to code, I would like to know what tools I should use in the future for this type of challenge?

Other feedback welcome !

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Varun Pandey•80
    @varunUk09
    Posted almost 3 years ago

    good job i have few suggestions for you

    1. avoid use of H1 more than once there should be only one heading in a perticular section
    2. use picture element if you wanna switch between images in different divices refer:w3shool picture element
    3. <h2 class="pro-cat">P E R F U M E</h2> don't do like this , if you want more gap between letters use letter-spacing instead.
    4. <img src="images/icon-cart.svg" alt="cart-icon"> try to put svgs instead of using them in img tag because svg a vector images they form where there code puts in means if you just directly add svg code you will save time to load them as a image from server.

    5).pro-cat{ font-size: small; } wrap using <small></small> tag instead

    6).new-price{ color:hsl(158, 36%, 37%); }

    .old-price{ margin-bottom: 0; font-size: small; text-decoration: line-through; }

    button{ width:100%; padding:1rem; background-color: hsl(158, 36%, 37%); }

    here you have used hsl(158,36%,37%) 2times , follow DRY principle always use css variables if you think you will use that property more than 1 im giving you an example below: :root{ --color-1:hsl(158,36%,37%); }

    now i can use var(--color-1) where i want this color and if in future client wants to change this color to different color so it will be simple easy for me to do this i will just change this color in root part. i hope all suggestions will help you and learn about flex please

    Marked as helpful
  • Andrei•110
    @sweLL98
    Posted almost 3 years ago

    You can also use 'border-radius: 15px 50px 30px 5px' - first value applies to top-left corner, second value applies to top-right corner, third value applies to bottom-right corner, and fourth value applies to bottom-left corner)

    You can see more here: https://www.w3schools.com/cssref/css3_pr_border-radius.php

    I hope can help you that and to make you faster to write!

    Marked as helpful

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