Design comparison
Community feedback
- @VladMishchukPosted over 1 year ago
ΠΡΠΈΠ²ΡΡ, good job)π
Your component is stretched in height and looks disjointed.
This is because you specified the property
height: 100vh;
for the.container
selector.Together with the properties:
display: flex; justify-content: center; align-items: center;
you can get the desired centered block, but problems arise. For example, stretching in height.To solve this shortcoming, I recommend slightly changing the
body
and.container
selectors: cutheight: 100vh; display: flex; justify-content: center; align-items: center;
from the selector.container
and insert forbody
. (for.container
leavedisplay: flex;
)In order for the component to look as it does on the layout, you need to add a shadow for the selector
.container
(the entire component)Here are all the changes I propose:
body { font-family: "Hanken Grotesk", sans-serif; font-size: 18px; font-weight: 500; margin: 0; padding: 0; background-color: hsl(0, 0%, 100%); height: 100vh; display: flex; justify-content: center; align-items: center; } .container { width: 500px; display: flex; background-color: hsl(0, 0%, 100%); /*the shadow will visually unite the elements*/ box-shadow: 15px 15px 25px hsl(221, 100%, 96%); border-radius: 30px; } /*flex elements occupy the entire height of the parent element by default - "height: 100%" is not needed;*/ .result-container { background: linear-gradient(hsl(252, 100%, 67%), hsl(241, 81%, 54%)); width: 50%; border-radius: 30px; } .summary-container { font-size: 12px; width: 50%; border-radius: 30px; }
I hope you find it useful)
And remember - "The difference between a novice and a master is that a master has failed more times than a novice had tried."
Marked as helpful0
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