Product-Preview-Card-Component (React and Tailwind)
Design comparison
Community feedback
- @tatasadiPosted 12 months ago
Hey, great job on completing this challenge!
Your
Product
component is well-structured, and you've done an excellent job implementing responsive design with Tailwind CSS. The use of classes for styling and layout demonstrates a solid understanding of modern CSS frameworks.I do have one small suggestion for improvement. Currently, the pricing information (
$149.99
and$169.99
) in your component is not perfectly aligned. To enhance the visual appeal and ensure a consistent layout, consider wrapping the prices in a parentdiv
and using Flexbox to align them. This approach can provide better alignment and adaptability, especially when dealing with varying text lengths or sizes.Here's how you can modify your pricing section:
<div className="py-4 px-6 md:px-5"> {/* ... other content ... */} <div className="flex items-center"> <span className="text-[#3D8168] font-frau font-bold text-[2rem]"> $149.99 </span> <span className="text-[#6C7289] ml-6 line-through"> $169.99 </span> </div> {/* ... button ... */} </div>
In this modification I wrapped both the current price and the original price in a
div
withflex
anditems-center
. This ensures that the prices are aligned on the same line and centered vertically relative to each other.This small change will make the pricing section of your product card look more polished and professional. Keep up the excellent work, and continue exploring and enhancing your front-end development skills!
Marked as helpful0@mehdias63Posted 12 months agoHello dear friend, Thank you very much for your guidance. Changes have been made, and the prices seem better now.@tatasadi
0
Please log in to post a comment
Log in with GitHubJoin 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