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

Solution | Product Preview Card Component | HTML, CSS, Floating Images

Rhythm 30

@Rhythm001

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


How do I position both image icon and text in the "Add to Cart" button? I just managed to awkwardly space them according to the image. Does anyone have any solution?

Community feedback

@VCarames

Posted

Hey @Rhythm001, regarding your question:

You will insert the image and text inside the Button Element and use Flex to align them.

<button>
          <img src="images/icon-cart.svg" alt="" aria-hidden="true"> Add to
          Cart
 </button>

Happy Coding! 👻🎃

Marked as helpful

1

Rhythm 30

@Rhythm001

Posted

@vcarames Thank you for introducing me to Flex. I was totally unaware about it until now. Happy Coding! 👻🎃

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