Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted almost 3 years ago

Used Flexbox and translateY for button positioning.

Scynes•190
@Scynes
A solution to the Advice generator app challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Project Difficulty and Code Uncertainty

I recently built a random advice generator app, which involved pulling data from an API each time the "dice" was rolled. While the app had a simple design, I found positioning the "dice" button half on and half off the div at the bottom to be a bit challenging. Ultimately, I used a combination of flex and absolute positioning with translateY to achieve the desired effect.

However, I'm still unsure if this was the best approach. In addition to this, there may be other areas of my code that could be improved or optimized.

Questions About Best Practices

In light of the above, I have a few questions about best practices that I would appreciate some guidance on. Are there any better ways to position the "dice" button half on and half off a div? What are some best practices for optimizing code in a project like this? I'd love to learn more about how to improve my skills and techniques for future projects.

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 Scynes'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