I really like that you kept your code simple and readable, and how you used grid for positioning elements — well done! Based on what I see in your code, I have a couple of tips:
First, try using semantic elements like <main>
, <section>
, <article>
, and <footer>
instead of relying only on <div>
s to improve the semantics of your HTML. These elements help assistive technologies communicate the content's structure and hierarchy more effectively, which is crucial for individuals with disabilities.
Also, if you want your <div class="main">
element to be centered in the viewport, I recommend changing the position of the attribution to fixed. This will take the attribution element out of the document flow, preventing your main element from being shifted up. Try adding the following code to the attribution: .attribution { position: fixed; bottom: 0; }
.
I see that fetching data from the JSON file works perfectly now — you figured out how to fix the error too :) For your JavaScript code, I have a small suggestion: it’s generally better to declare variables with const
or let
instead of var
to avoid unexpected behavior related to variable scope.
Hopefully, these tips will be useful for you!