Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

advice generator using grid and axios.

#axios

@akhilchary08

Desktop design screenshot for the Advice generator app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
  • API
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


I used css grid for structuring the html. For fetching data from the api endpoint axios has been used. There are 224 advice slips in advice slip api. For every click from the user a function is called. In the function call a random number is generated using Math.random() function of javascript which ranges between 1 to 224. for every random generated number serves as an Id and using the Id corresponding advice is fetched. I hope learn further from others solutions. 🙂

Community feedback

Sandro 1,170

@sandro21-glitch

Posted

Hi akhilchary

Here are a few suggestions for improvement on your code:

Use semantic HTML elements where appropriate, such as <header>, <nav>, <main>, <article>, <aside>, and <footer>.

Provide alternative text for the <img> elements using the alt attribute, to make the content accessible for people using screen readers.

Use CSS variables to store values that are used repeatedly throughout your styles, such as colors or font-sizes. This will make it easier to make global changes to your styles.

Try to avoid using inline styles and instead use CSS classes for styling.

Use descriptive and meaningful class names, such as .advice-card instead of .main to make your code more readable and understandable.

Use CSS Flexbox or Grid for layout instead of position absolute where possible, as they are more versatile and easier to use for most layout tasks.

Happy Coding

Marked as helpful

1

@akhilchary08

Posted

Thank you so much;@sandro21-glitch I'll do my best to be better while taking your suggestions into account.

0

Please log in to post a comment

Log in with GitHub
Discord logo

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