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.
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
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
That’s because of
text-align: center;
just below the line-height: 3;
line.
How did I miss that
Thanks again.
Sometimes we look so hard for something, we can’t find anything.