Design comparison
Community feedback
- @Islandstone89Posted 8 months ago
HTML:
-
Every webpage needs a
<main>
that wraps all of the content, except for<header>
andfooter>
. This is vital for accessibility, as it helps screen readers identify the "main" section of a page. Wrap all of the code in a<main>
. -
Use classes instead of IDs for styling.
-
The alt text should be written naturally, with lowercase letters and without using
-
between the words. It must also say where it leads(frontendmentor.io).
CSS:
-
It's good practice to include a CSS Reset at the top.
-
Add around
1rem
ofpadding
on thebody
, so the card doesn't touch the edges on small screens. -
On the
body
, changeheight
tomin-height
- this way, the content will not get cut off if it grows beneath the viewport. -
Remove
gap
, it isn't a valid value without declaringdisplay: flex
. -
I would use
em
forword-spacing
instead ofpx
. I don't think you need it on this challenge, though. -
Remove the margin on the image, and change
max-width
to100%
- the max-width prevents it from overflowing its container. Also removecursor: pointer
- it should be used for interactive elements, like links. -
Add around
1rem
ofpadding
on the card, to create the space between the image and the card edges.
Marked as helpful1@KennedyBarretoPosted 8 months ago@Islandstone89 Thanks for the feedback and tips. I usually use semantic HTML, but since this is a relatively small piece of code, I let it slide. I wasn't familiar with all these CSS resets, but I'll definitely be using them more frequently from now on.
1@Islandstone89Posted 8 months ago@KennedyBarreto Happy to help :) Always use semantic HTML, though!
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