@kaamiik
Posted
Hi. Congratulation for doing this challenge.
I think Your html is good. For your heading, I suggest using max-width
instead of using br
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 helpful
Hi @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 the rem
unit where it was missing on one of the line-height
elements.
Thanks again!
@kaamiik
Posted
Great! @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 the rem
here and also use 1.1 for your headings.
Hi @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!