Single price grid component // Mobile First, Grid
Design comparison
Solution retrospective
Maybe I could change the positioning of the $29. Hadn't been coding for a week, so feel proud I made this, without too many issues.
Community feedback
- @rfilenkoPosted about 4 years ago
Hi Katrien, the simplest solution - put those 2 elements into one container, and make it flex {display: flex; align-items: center;}. Adjust other needed css properties (margin, padding) for child elements as well.
Cheers, Roman
2@katrien-sPosted about 4 years ago@rfilenko Yeah, that did the trick. Thank you.
0 - @Sven72Posted about 4 years ago
Hi Katrien, I solved the $29 with placing "$29 per month" into a
</div>`div
giving both "$29" and "per month" ap
tag with a unique class. (Maybe an ID would be better?) `<div class="flex-container__row"> <p class="dollar">$29</p> <p class="month">per month</p>Than I applied in CSS
display: flex
to the div. So thep
elements are aligned by default in a row.To center the month class vertically I need the align property from flex. So I have in my CSS:
.month { align-self: center; color: var(--light-gray); padding-right: 90px; }
Hope, this makes sense. Best, Sven1 - @tarasisPosted about 4 years ago
👋 Katrien
Congrats! Desktop is close 👍
Don't forget the border-radius.
Regarding the mobile version, it currently fills up the whole screen and doesn't look like a component (or the mobile design).
I'd suggest in
wrapper
setwidth: 90%;
and themargin: auto;
and removeheight: 100vh;
fromcontainer
and add the following tobody
height: 100vh; margin: auto; display: flex; flex-direction: column;
Keep up the great work
🖖
0@katrien-sPosted about 4 years ago@tarasis Added the border-radius and made the mobile version a component with your input. Thank you :)
0
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