Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Price Grid Gomponent using CSS Grid

@DLMedeiro

Desktop design screenshot for the Single price grid component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

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

P

@webdevbynight

Posted

Hello,

Flexbox can be used, but you can also leave the span elements displayed inline, in which case you just use the vertical-align property on the first span 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
faizan 2,420

@afaiz-space

Posted

Hey @DLMedeiro,

  • add display: flex; align-items: center; gap: 8px; in h3 tag for vertical center alignment.
0

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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