Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 12 months ago

Responsive Product preview card component Css flex

pure-css
tchananet•170
@tchananet
A solution to the Product preview card component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What specific areas of your project would you like help with?

I have issues with matching pixel for pixel. I can't exactly nail the positioning, the sizes. So its always a bit off.

Code
Couldn’t fetch repository

Please log in to post a comment

Log in with GitHub

Community feedback

  • Gwenaël Magnenat•1,540
    @gmagnenat
    Posted 12 months ago

    Hi, congrats on completing the challenge ! it looks quite close already :)

    To help you match a design you can use this perfect pixel chrome extension. You can use the snapshot present in the starter files in this extension and it will add an overlay on top of your webpage. you can move the overlay and adapt the value in the developer console, then adapt your css with the values you find.

    You should add a proper css reset at the begining of your stylesheet it will help as well deal with default browser styling conflict. good and modern css reset.

    I hope you find these recommendations useful. Let me know if you have any questions.

    happy coding !

    Marked as helpful
  • Grace•32,130
    @grace-snow
    Posted 12 months ago

    Some quick feedback

    • remove explicit widths. The component should only have a max width in rem.
    • fix the html. Specifically heading use and order, and use of image alt. See https://fedmentor.dev/posts/html-plan-product-preview
    • use a css reset at the start of the styles.
    • you shouldn't need any !important in the styles. That's a sign there are problems in the css. Fix them don't try and brute force override them.
    • don't guess font sizes. I can tell you're choosing random rem values. They shouldn't need to change between movie and desktop. Use the size the style guide says for body/paragraph.
    • the img needs object-fit
    • the picture element should only have one source in this for the desktop image.
    • only set media queries when there is room for the layout to change. Define media queries in rem or em not px. And make the mobile styles the default with larger screen styles in the media query. See https://fedmentor.dev/posts/responsive-meaning/
    Marked as helpful
  • P
    Daniel 🛸•44,740
    @danielmrz-dev
    Posted 12 months ago

    Hello there!

    Congrats on completing the challenge! ✅

    Your solution looks excelent!

    I have just one suggestion:

    📌 To improve semantic clarity, try to maintain the titles hierarchy with <h1>, <h2> <h3>, and so on.

    It's more than just text size — it's about structuring your content effectively:

    • <h1> to <h6> are used to define HTML headings, with <h1> being the most significant.

    While these adjustments might not alter the visual appearance much, they significantly enhance semantic clarity, SEO optimization, and accessibility.

    Hope this suggestion proves helpful! Keep up the great work!

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
Frontend Mentor logo

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 1st-party linked stylesheets, and styles within <style> tags.

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.

Frontend Mentor for Teams

Frontend Mentor for Teams helps companies and schools onboard and train developers through project-based learning. Our industry-standard projects give developers hands-on experience tackling real coding problems, helping them master their craft.

If you work in a company or are a student in a coding school, feel free to share Frontend Mentor for Teams with your manager or instructor, as they may use it to help with your coding education.

Learn more

Oops! 😬

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

Log in with GitHub

Frontend Mentor for Teams

Frontend Mentor for Teams helps companies and schools onboard and train developers through project-based learning. Our industry-standard projects give developers hands-on experience tackling real coding problems, helping them master their craft.

If you work in a company or are a student in a coding school, feel free to share Frontend Mentor for Teams with your manager or instructor, as they may use it to help with your coding education.

Learn more

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