Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Request path contains unescaped characters
Not Found

Submitted

Responsive Product Card - Css

tayblackk 30

@tayblackk

Desktop design screenshot for the Product preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


There was a time when I had to refer back to MDN doc for clarification regarding grid and flexbox. I've been challenging myself to clean up my CSS so it is more legible for viewers.

Another challenge I faced within the project was the image.svg.. I could not figure it out and I began to get so tired that my problem solving skills turned into frustration.

You will find this at the bottom of the CSS stylesheet.

/* Having trouble adding the .svg - Really not even sure what is going on - Probably too tired / / .btn[data-icon="shopping-cart"]::before { content: ""; background-image: url("images/icon-cart.svg"); background-color: #fff; width: 15px; height: 16px; } */

I should have been more patient and tried to solve the issue. Nonetheless, I will be back tomorrow for another challenge. This is the conclusion of my 4th week of self-taught html & css.

Community feedback

@J-HernandezM

Posted

hi! i made it by adding a img tag inside the button tag, i didnt even think you could do it using css, thats an original hehe

<button type="button" class="cardContainer__cartButton btn">
             <img src="./images/icon-cart.svg" alt="add to cart logo" class="cart"/>
              Add to Cart 
</button>

Marked as helpful

0

Please log in to post a comment

Log in with GitHub
Discord logo

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