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
Not Found
Not Found

Submitted

Product preivew card component

Bandaru Sindhujaβ€’ 190

@SindhujaBandaru

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


In this challenge I faced an issue to center the cart icon and i tried so many times but failed to center it. Please guide me on how to center it. Not only that but also give feedback on my code since Iam a newbie i can improve my skills.Thankyou.

Community feedback

Lucas πŸ‘Ύβ€’ 104,420

@correlucas

Posted

πŸ‘ΎHello Bandaru Sindhuja, congratulations for your new solution!

Answering your question:

All you need to to is to use display: flex for the button + icon alignment, see the code below:

.button {
    display: flex;
    text-align: center;
    max-width: 100%;
    align-items: center;
    justify-content: center;
}

πŸ‘‹ I hope this helps you and happy coding!

Marked as helpful

1
alaaballoutdevβ€’ 90

@alaaballoutdev

Posted

Keep going , but you can improve your work by searching how to centralize the div whatever the size of screen is , and my code in this challenge to centralize the div might be helpful for you.

hints:
position:absolute;
right:50vw;
top:50vh;
margin-right:  - widthofdiv/2;
margin-top:  - heightofdiv/2;

Good luck!!

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