Results Summary challenge with Fetch API and DOM
Design comparison
Solution retrospective
I attempted using Fetch API to display information from a JSON file to an HTML file. Please let me know if there was a better way of going about it, if I should've structured my CSS file better or what best practices I could've used from semantics to CSS concepts.
Community feedback
- @K01wfdPosted about 1 year ago
Hi @Jen-464, some tips for the solution:
1- For the HTML structure you could use main element and a (blockqoute or article ) inside main, then use divs to wrappe each section and work with them easily.
2- if you are using JS to dynamically display the results, when fetching data make sure you are using asynchronous requests so the operation will wait for the data to be fetched (considering real world examples).
3- use arrow functions when using callback.
4- for your css global reset, instead of specifiying different font property just use font: inherit and you good to go, and maybe you should consider using relative units when dealing with sizes instead of pexels.
5- when selecting elements in css use classes instead of (id)s, try to avoid raising specificity by combining too many selectors, cause it will be hard to debug later when the codes become more complicated.
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