@rfilenko
Posted
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
Looking to hire developers?
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.
@rfilenko
Posted
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
@Sven72
Posted
Hi Katrien,
I solved the $29 with placing "$29 per month" into a div
giving both "$29" and "per month" a p
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 the p
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,
Sven
@tarasis
Posted
š 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
set width: 90%;
and the margin: auto;
and remove height: 100vh;
from container
and add the following to body
height: 100vh;
margin: auto;
display: flex;
flex-direction: column;
Keep up the great work
š
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