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

Frontend Mentor | Results summary component

Hacklieβ€’ 80

@Hacklie

Desktop design screenshot for the Results summary component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


What challenges did you encounter, and how did you overcome them?

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

P
Luis Veraβ€’ 170

@LuisVera1

Posted

@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 use summary-category instead.

And as for your error, it is caused by this line in your html

`

Marked as helpful

1
Daniel πŸ›Έβ€’ 44,230

@danielmrz-dev

Posted

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 or margins 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 helpful

1
P
Luis Veraβ€’ 170

@LuisVera1

Posted

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 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