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

Product Preview card component

sass/scss
NKEMBOH ISAIAH•50
@Isaiah-0914
A solution to the Product preview card component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Please I worry. When I run my project locally it's cool but when I view it from the live site I hosted on GitHub it shows the mobile version(on a laptop). As you can realize the display from my screenshot is different from how it is displayed on the live site. I don't understand why please help me out!

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Santiago Moraga Caldera•710
    @Remy349
    Posted over 2 years ago

    Hello @Isaiah-0914, the responsive design is available but only from the 1440px size, in that size shows you the card as it should be in the challenge. As a recommendation make sure you change the media queries measures, usually I adapt it from 1000px or 1200px, this way I make sure it shows the expected result in most of the devices. Your problem is due to the fact that there are different screen sizes, so some will display correctly and others will not. Example: on my laptop the card does not look good because the size of my screen is 1360px. I hope this helps you :)

    Marked as helpful
  • Liyan Anajao•990
    @LiyanNguyen
    Posted over 2 years ago

    Hi Isaiah,

    I took a look at your source code, do review the @media query and the difference between (min-width) and (max-width)

    also try not to specifically target 1440px, try doing something like (max-width: 1080px) on the .box class, I tried it on manually on browser dev tools and it works

    hope that helps

    Marked as helpful
  • Uday Kumar•80
    @UK0724
    Posted over 2 years ago

    Hi @Isaiah-0914 👋, good job completing this challenge.

    • I have looked into your code, You have used margin "200px auto"
    .box {
        display: flex;
        width: 40%;
        /* max-width: 500px; */
        margin: 200px auto;
        /* border: 2px solid; */
        border-radius: 15px;
        /* overflow: hidden; */
        /* height: 50%; */
        background-color: white;
    }    
    
    • insted of using margin you can use flex propertIies. since you already used it.
      .box{
            display:flex;
            justify-content:center;
           align-items:center;
    }
    

    the above code will center the box

    I hope those tips will help you.

    Good job, 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
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.

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

Oops! 😬

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

Log in with GitHub