Skip to content
  • Learning paths
  • Challenges
  • Solutions
  • Articles
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 10 months ago

Product Preview Component with Tailwind CSS!

tailwind-css, react
Laura Nguyen•130
@laura-nguyen
A solution to the Product preview card component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

This is my first time using Tailwind CSS and I'm happy with what I produced. What I would do differently next time is to try to get precise measurements with certain elements on padding, margin etc. I didn't have access to the Figma file so I didn't know what the measurements were. I would have converted the mockup screenshots into a Figma design.

What challenges did you encounter, and how did you overcome them?

There was a learning curve with Tailwind. I didn't realize there were additional steps to install Tailwind. Also, I didn't know much of the syntax for styling certain element such as padding, hover etc. I overcame this learning curve my referencing this cheatsheet from Nerdcave. https://nerdcave.com/tailwind-cheat-sheet

Overall I can see why Tailwind is really popular. It saves a lot of time - I just need to get used to seeing styling on an html/js page

What specific areas of your project would you like help with?

What's the difference between using App.css and index.css? I ended up putting the base styles on index.css but I didn't put anything on App.css.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Grace•32,130
    @grace-snow
    Posted 10 months ago

    There are some issues with the markup on this that are really foundational. Rather than go through them all here, I’ll point you to an article I wrote about planning html that looks at this specific challenge: https://fedmentor.dev/posts/html-plan-product-preview/.

    The only thing that’s less relevant now is that from what I understand screen readers now announce strike through text, so you may not need to add the screen reader only text any more about the old price. I need to check that then I’ll update the article.

    I hope it helps anyway.

  • Rahat•20
    @rahatfaruk
    Posted 10 months ago

    Hey, the small and large design is pretty good. but on medium device, it's width becomes too much. you can use max-width on the card until it touches large screen. I'd be happy if you rate my work also :)

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

Frontend Mentor for Teams

Frontend Mentor for Teams helps companies and schools onboard and train developers through project-based learning. Our industry-standard projects give developers hands-on experience tackling real coding problems, helping them master their craft.

If you work in a company or are a student in a coding school, feel free to share Frontend Mentor for Teams with your manager or instructor, as they may use it to help with your coding education.

Learn more

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