Design comparison
Solution retrospective
Any suggestions will be much appreciated
Community feedback
- @sandro21-glitchPosted almost 2 years ago
Hi Hasan
Here are some general suggestions for your code:
Use semantic class names to make your code more readable and maintainable.
For example, instead of using .text, use .advice-text to indicate that it's the text of the advice.
You may consider using CSS Grid or Flexbox for the layout, instead of absolute positioning for the elements. This will make your layout more flexible and easier to maintain.
Use the rem unit for font-sizes and spacing, as it makes it easier to scale the design and maintain a consistent layout across different devices.
Good Luck
Marked as helpful1 - @adkenneyPosted almost 2 years ago
Hi Hassan! Nice job completing the challenge
I have some suggestions that may be helpful.
I noticed you made an incrementing variable for the advice number. The Advice Slip API slip object has an id value which you can use instead of having to increment a variable each fetch call.
Also if you want to have an advice slip displayed before having to press the button you can look into having the fetch call happen during an onload event. More information here 📘
Hope I could help! Happy coding!
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