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

E-commerce product page

sass/scss
Amritpal Singh•200
@AmritPal91
A solution to the E-commerce product page challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Can someone tell about best practices for this challenge?

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Juan Miguel Cardona A•50
    @juanprog97
    Posted over 2 years ago

    hey Amritpal Singh, I see that you are missing the border that indicates the selected image, here is a solution so that you can lower the opacity and still have the border visible.

    1- you should wrap the img in a div . For the div the border style is applied and in the child img the opacity is lowered and thus does not affect the visibility of the border. HTML

    <div class="container-img">
       <img src="https://http2.mlstatic.com/D_NQ_NP_658639-CBT50339432941_062022-W.jpg">
      </div>
    

    CSS

    div.container-img{
      display: block;
      width:300px;
      height: 300px;
      border: 6px solid black;
      
    }
    .container-img img{
      width: 100%;
      height: 100%;
      opacity: 0.4;
    }
    

    happy coding👍🏻🔥💯

  • S MD suleman•3,510
    @sulemaan7070
    Posted over 2 years ago

    hey Amritpal Singh😄, congratulations on completing the challenge here are a few tips to make your site better...

    1.You can the cursor:pointer on the +,- and the delete svg..

    2.When I am adding 4 items.. and pressing the Add to cart the 4 should become 0.

    3.on the mobile: the images inside the carousel are getting squeezed you can use the object-fit:contain to tackle that problem..

    4.And for the (mobile-menu) or .navigation you can add

    .navigation {
        position: fixed;
    }
    

    so that user cannot scroll down the menu..

    Everything else looks great!! 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