Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 1 year ago

Interactive rating component using HTML, CSS and JS

jadefurtado•80
@jadefurtado
A solution to the Interactive rating component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


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

Initially, I tried to make the JavaScript code change the style.display of the thank you card from 'none' to 'block', but this interfered with the layout and the behavior of the flexbox. When you hide the card with display: none, the element is completely removed from the page flow, which can sometimes break the layout when re-displayed with display: block. Instead of using display: none and display: block, it is safer to use visibility and opacity to prevent the layout from breaking when the content is hidden and displayed. I also had to adjust the position of the cards. I created a card-container div to wrap both cards and used position: relative. In the cards, I used position: absolute so that they occupy the exact same space within this container.

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on jadefurtado's solution.

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

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner
  • Use cases

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