Assessment: A cool-looking box

Hey guys, I’d really like an assessment on the following task:

Task: https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/A_cool_looking_box

Solution: https://codepen.io/Dominicode/pen/gOvPVxz

All suggestions are welcomed.

Hi again @why_not_phoenix

Another great solution!

Instead of using height and padding you could also just use line-height. This would also make sure that the text is centered vertically. For example line-height: 3; would be a good value.

Cheers,
Michael

2 Likes

Hey @mikoMK

I updated my code as per your suggestion and it worked :slightly
I have a question though, I understand why the text moves to the center vertically but why doesn’t it stick to the left hand side of the button?
I hope my question is clear enough, I’d really appreciate your answer.

Phoenix

1 Like

That’s because of

text-align: center;

just below the line-height: 3; line.