I only used HTML and CSS, also I used the CSS @media to make it better
Design comparison
Solution retrospective
I really like how my mind has think of how i could make that exactly as the example
What challenges did you encounter, and how did you overcome them?The first challenge I found was of how to make it for mobile devices, but I found a website which help me during this process.
What specific areas of your project would you like help with?I would like to know If I could do the code smaller to make it more eficcient.
Community feedback
- @Islandstone89Posted 3 months ago
Hey there, well done!
My feedback:
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. Wrap the card in a<main>
. -
The alt text should be written naturally, without using
-
between the words. 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(the frontendmentor website). A good alt text would be "QR code leading to the Frontend Mentor website."
CSS:
-
Including a CSS Reset at the top is good practice.
-
Use the style guide to find the correct
font-family
, and remember to specify a fallback font:font-family: 'Outfit',sans-serif;
-
I like to add
1rem
ofpadding
on thebody
, to ensure 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. -
max-width
on the card must be in rem - I would change it to20rem
, which equals320px
. -
On the image, add
display: block
and changewidth
tomax-width: 100%
- the max-width prevents it from overflowing its container. -
Instead of using descendant selectors like
.text-container h2
, it is recommended to add a class to an element, for example:<h2 class="card-heading">
. -
As the design doesn't change, there is no need for any media queries. When you do need them, they should be in
rem
orem
, not px. Also, it is common practice to do mobile styles first and use media queries for larger screens.
Marked as helpful0 -
- @baturalperbayPosted 3 months ago
Hello RogerTito, well done on your solution :)
For mobile devices, one trick that is used often is to make width of containers in percentages. Try setting width: 90% on your container and see how it behaves.
It is good that you are using rem units, you can also check out "container query length"s at Container Queries. However this is absolutely not high priority whatsoever and it should be noted that browser support for Container Queries is still inadequate.
Happy coding :)
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