@Islandstone89
Posted
HTML:
-
Do not remove the
<main>
, it is essential to have. And you have the card as.container
, which is perfectly fine. -
The image has meaning, so it must have proper alt text. Write something short and descriptive, without including words like "image" or "photo". Screen readers start announcing images with "image", so an alt text of "image of qr code" would be read like this: "image, image of qr code". The alt text must also say where it leads(frontendmentor.io).
-
.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.
-
Add around
1rem
ofpadding
on thebody
, so the card doesn't touch the edges on small screens. -
You don't need to set anything on
html
, so I would remove that selector. -
Remove all of the
position
properties, they are not meant to be used for layout. -
To center the card horizontally and vertically, use Flexbox on the body:
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100svh;
-
Move
background-color
andborder-radius
frommain
to.container
. Remove the width and height inpx
- you rarely want to set fixed dimensions, so this is something to keep in mind. -
Add a
max-width
of around20rem
on the card, to prevent it from getting too wide on larger screens. -
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. -
Since all of the text should be centered, you only need to set
text-align: center
on the body, and remove it elsewhere. The children will inherit the value. -
Paragraphs have a default value of
font-weight: 400
, so there is no need to declare it. -
On the image, add
display: block
. Removeheight: auto
, as that is the default value. -
As the design doesn't change, there is no need for any media queries. When you do need them, they should be in rem, not px. Also, it is common practice to do mobile styles first and use media queries for larger screens.
Hope this helps :)
Marked as helpful
@dpiskov
Posted
@Islandstone89 Wow, that's a lot of useful information, thank you! I appreciate it a lot! I'll take my time soaking this information up and try hard to understand it! :)