Design comparison
Solution retrospective
I am mostly proud that i was able to complete the project on my own without taking any help. I am proud that I was able to make it responsive according to the design.
What challenges did you encounter, and how did you overcome them?I did faced the challenge of aligning the box in the center . It was tough in the beginning but I am happy that I was able to find the solution.
What specific areas of your project would you like help with?I would like help on positioning of the container in different positions.
Community feedback
- @Islandstone89Posted 6 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 a page's "main" section. Change.container
into a<main>
. -
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 website). A good alt text would be "QR code leading to the Frontend Mentor website."
-
Headings should always be in order, so you never start with a
<h3>
. A card heading would probably not be the main heading on a page, so make it a<h2>
instead of a<h1>
.
CSS:
-
Including a CSS Reset at the top is good practice.
-
I like to add
1rem
ofpadding
on thebody
, to ensure the card doesn't touch the edges on small screens. -
You don't need
font-style
andfont-optical-sizing
, as the values you declare are the default. -
Move the properties on
.container
to.box
. Removeposition
,top
,left
andtransform
- they are not ideal for creating a layout. -
To center the card horizontally and vertically, I would instead use Flexbox on the body:
display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 100svh;
-
Remove the
width
on the card - setting fixed sizes inpx
is not recommended, as our components should stretch and shrink according to the screen it's viewed on. -
That being said, we don't want the card to stretch indefinitely. 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 a big accessibility issue, as it prevents the font size from scaling with the user's default setting in the browser. Use rem instead. -
On the image, add
display: block
and changewidth
tomax-width: 100%
- the max-width prevents it from overflowing its container.
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