Design comparison
Solution retrospective
The barely visible border at the corners in the summary took longer than expected.
There is also an error message in the console: "Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "application/json". Strict MIME type checking is enforced for module scripts per HTML spec."
I haven't found a solution for this, but that's not too bad, because loading the data from the json still works. And in real life you would rather get the data from an API and not from a local json file.
Community feedback
- @LuisVera1Posted 7 months ago
@Hacklie
Your solution looks great! However, here are some suggestions.
--- Use the appropriate HTML element
- Use the
<main>
to wrap all the content instead of a<div>
element. - Your html has a lot of commented code, if this is not necessary, better delete it.
--- Css
- The names of the classes are very large, for example:
results-summary__summary-div-category
, you can usesummary-category
instead.And as for your error, it is caused by this line in your html
`
Marked as helpful1 - Use the
- @danielmrz-devPosted 7 months ago
Hello, @Hacklie!
Your project is looking fantastic!
I'd like to suggest a way to make it even better:
- Using
margin
isn't always the most effective method for centering an element.
Here's a highly efficient approach to position an element at the center of the page both vertically and horizontally:
π Apply this CSS to the body (avoid using
position
ormargins
in order to work correctly):body { min-height: 100vh; display: flex; justify-content: center; align-items: center; }
I hope you find this helpful!
Keep up the excellent work!
Marked as helpful1 - Using
- @LuisVera1Posted 7 months ago
Hi, something wrong with the last comment π€
The error is in the line 14 in your html
< script type= "module" src= "./data.json">< /script >
You can also get the data with 'fetch', so it doesn't matter if the data is local or comes from an API, your project is ready!
Good job!, greetings.
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