Design comparison
Solution retrospective
Proud of my use of the CSS grid, which I only learnt an hour before embarking on this project. I worked out the number of rows and columns needed beforehand in order to meet the design, which looks pretty accurate now.
What challenges did you encounter, and how did you overcome them?Initially had challenges centering both the top part and the blocks on the page using CSS grid, with them slightly to the left and right, however flexbox worked.
What specific areas of your project would you like help with?I would like someone to check over my CSS grid usage and check it is as responsive as possible, matching the brief.
Community feedback
- @kaamiikPosted about 1 month ago
Hi. Congratulation for doing this challenge.
I think Your html is good. For your heading, I suggest using
max-width
instead of usingbr
tag.Your images are decorative and do not need
alt
text.For your
line-height
I see using it without unit. If you divide your line-height value to your font-size, It is mostly between 1.1 (for headings) to 1.7 (for body).Marked as helpful0@marcus-hillPosted about 1 month agoHi @kaamiik , thanks for reviewing my solution. I've removed the
br
element and added a max width (different for both desktop and mobile) which has worked. I've also removed the alt tags from the images and added therem
unit where it was missing on one of theline-height
elements.Thanks again!
1@kaamiikPosted about 1 month agoGreat! @marcus-hill
For the
line-height
you don't need any unit. This is the MDN definition for using it without any unit:" The used value is this unitless <number> multiplied by the element's font size. The computed value is the same as the specified <number>. In most cases this is the preferred way to set line-height with no unexpected results in case of inheritance. "
So If your font-size is 16px and line-height with no unit is 1.5, then your line-height in
px
is:16 * 1.5 = 24px;
Inside your design file sometimes they mention the line-height in pixel and you can easily convert it to unitless. But If they don't, usually It's 1.5 for body and 1.1 for headings. As I see you did this:
line-height: 1.5rem;
You have to delete therem
here and also use 1.1 for your headings.0@marcus-hillPosted about 1 month agoHi @kaamiik ,
This makes sense now! Thanks a lot for explaining it. I was using rem in a similar way to how it should have been done with the unitless version then, so for the one with rem I have just deleted the rem and adjusted the others so they are multiplied by the font size to make the desired line height.
I will bear this in mind for the future!
1
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