Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 2 years ago

Product landing card using CSS grid

Nann Ei Ei Win•140
@neew18
A solution to the Product preview card component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Hi! This is my solution for the Product preview card challenge. I am still struggling to make those card center I guess but I am working on it. And I have a problem on my code which I can't seem to pin point what it is. Because it is working on my codepen. It is like when I deployed the page the responsive apart is not working and it is still at the mobile version. Please help me find what it went wrong and any other suggestions are welcome!!

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Muhammadh•1,140
    @Mr-jaw
    Posted over 2 years ago

    Hello 👋

    Well done on completing it

    some tips to improve your code

    HTML 📰

    • for headings avoid using <p> tags. In <p id="heading-small">Perfume</p> replace the <p> tag with a <h1> , and replace <h1>tag in <h1>Gabrielle Essence Eau De Parfum</h1> with a <h2> tag. So you will have a top-level heading which is <h1> and a second-level heading <h2> which will greatly improve accessibility.

    • avoid using <p> tag to display short texts(i.e <p id="price1">$149.99</p> and <p id="price2">$169.99</p>). Since the <p> tag is used to display descriptive text. Rather use <em>, <strong> or <small> tags. This will also improve accessibility.

    the above-mentioned are semantic HTML and accessibility issues

    Learn more about Semantic HTML here

    Learn more about Accessibility here

    CSS 🌈

    • It is always considered good practice to use CSS custom variables. They will make life a lot easier as a web developer. learn more about it here

    Other than that all looks great 🔥, you have used relative units which is great for responsiveness, and used a better approach to change images on mobile and desktop view

    I hope you find this helpful 😄

    KEEP IT UP

    Marked as helpful
  • aykutminikli•280
    @aykutminikli
    Posted over 2 years ago

    Hi, congratz on completing the challenge.

    The thing with your responsive problem is from what i see you made your media like this @media only screen and (min-width: 1440px). This makes your container to stay like in mobile version until the screen reaches 1440px. You should try lower widths like 500px or 600px.

    What is mean is @media only screen and (min-width: 600px) or @media only screen and (min-width: 500px) would be a better choice for breakpoints in this project.

    Hope this was helpful.

    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