Design comparison
Community feedback
- @Islandstone89Posted 10 months ago
HTML:
-
The image and icon are both decorative, meaning their alt text should be empty:
alt=""
. -
I would change "Order Summary" to a
<h1>
, and "Annual Plan" and the price to<p>
. -
.attribution
should be a<footer>
, and its text must be wrapped in a<p>
.
CSS:
-
Performance-wise, it's better to link fonts in the
<head>
of the HTML than using@import
. -
It's good practice to include a CSS Reset at the top.
-
Remove
align-content
, you only needalign-items
. -
On the
body
, remove the margin. Instead, add a bit ofpadding
, so the card doesn't touch the edges on smaller screens. Remove thewidth
- thebody
is a block element, meaning it is 100% wide by default. Changeheight
tomin-height
- this way, the content will not get cut off if it grows beneath the viewport. -
On the card, remove
align-self
,width
andmargin
. Also, max-width should be in rem - around20rem
works fine I think. NB: When you need horizontal margin, you can usemargin-inline
. -
font-size
must never be in px. This is bad for accessibility, as it prevents the font size from scaling with the user's default setting in the browser. Use rem instead. -
line-height
must also never be inpx
.
Marked as helpful0 -
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