Responsive Result summary component with css flexbox and media query
Design comparison
Solution retrospective
I need help on how to integrate the data.json file into my html. Thanks.
Community feedback
- @RabberpoliPosted over 1 year ago
Hi! Well done doing your first challenge! 😎 You’ve done a great job! Looking at your question I would say that you can’t import your json data directly into your HTML file; HTML is just a markup language, you can’t put logic in. In order to achieve your goal you have to write a JS file in which you import your JSON. After that you can create an array of object containing your scores; for each element you can create an HTML element (always JS speaking) with desired HTML/css attributes (“foreach” method in JS lets you iterate over array elements) and append every HTML element to its parent “div”. Once your JS file is done you have to import it in your HTML file. I hope to have given you some helpful tip. That said, keep going and happy coding 😎
Marked as helpful1
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