Hi
I would appreciate if someone could check my work on CSS assessment of styling a box.
I have two questions
(The same questions are also written in comments in my CSS sheet.)
I calculated and specified a unit-less value of line-height, but is this the right way to vertically align the text in the box? Is there a better way to do this?
How can I know the contrast between background colour and text colour are high enough for everyone to read? Is there any tool I can use?
Itโs fine to use line-height in this situation. Just be aware that it only works for single line text. Try adding some more words and see what happens.
I would also remove the height property. Then the height of the box solely depends on the line height. (No calculations needed to make it โfit inโ)
Another possibility would be to use the same padding for top and bottom (again without the height property).
When you open the Firefox DevTools and select Accessibility. You can activate the element selector and hover of the text to se the contrast.