Design comparison
SolutionDesign
Solution retrospective
Looking for input on how others would style the "$29 per month" piece.
Currently I have a H3 with 2 spans, the appearance is close, but this solution doesn't feel right and I wasn't able to center the "per month" portion.
Thanks!
Community feedback
- @webdevbynightPosted over 1 year ago
Hello,
Flexbox can be used, but you can also leave the
span
elements displayed inline, in which case you just use thevertical-align
property on the firstspan
to center it vertically. In other words:#money { vertical-align: middle; }
If you want to look further about vertical centering in CSS, just look at this resource on CSS Tricks.
0 - @afaiz-spacePosted over 1 year ago
Hey @DLMedeiro,
- add
display: flex; align-items: center; gap: 8px;
in h3 tag for vertical center alignment.
0 - add
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