Design comparison
Community feedback
- @0xabdulkhaliqPosted over 1 year ago
Hello there š. Congratulations on successfully completing the challenge! š
- I have other recommendations regarding your code that I believe will be of great interest to you.
CSS šØ:
- Looks like the component has not been centered properly. So let me explain, How you can easily center the component without using
margin
orpadding
.
- We don't need to use
margin
andpadding
to center the component both horizontally & vertically. Because usingmargin
orpadding
will not dynamical centers our component at all states, and also the important note is that you used mulitiple flex groups (almost 3) we don't need that much of level we can use flexbox for body only to center the component
- You already using
Flexbox
for layout, but you didn't utilized it's full potential. Just add the following rules to properly center the component.
body { min-height: 100vh; }
- Now remove these styles, after removing you can able to see the changes
@media (min-width: 1200px) section { width: 28.6%; margin: 195px 0 189px 0; display: flex; justify-content: center; align-items: center; flex-flow: row wrap; } section { margin: 154px 0; display: flex; justify-content: center; align-items: center; flex-flow: row wrap; }
- Now your component has been properly centered
.
I hope you find this helpful š Above all, the solution you submitted is great !
Happy coding!
Marked as helpful0@Hyuuga81Posted over 1 year ago@0xAbdulKhalid Hey Abdul! This worked perfectly when I took out the suggested code out of both sections and added the body {min-height: 100vh;}. Is it possible to explain what the vertical height is doing here? I know that display: flex is not inherited by the child elements of the body. At least it shouldn't be. Anyway thanks for helping me make my code a lot cleaner. Appreciate the tip!
0 - @frankuxurPosted over 1 year ago
Hey Frank here šāāļø
You did a great job there! šÆ
I just wanted to point out a few minor details that you might wanna consider to make the component look better:
ā you could add the transition style property to the submit button & the numbers, which would smoothly animate its background color
you could achieve this by adding this property to you button & numbers, here's an example:
button { transition: all 0.3s ease; }
ā another thing i noticed was the numbers. they are oval-shaped, and would look better if they were circles. to get that you can specify an equal height and width for each of these numbers, and give a border-radius of 50%, and then add a bit of padding. here's an example:
.number { height: 28px; width: 28px; border-radius: 50%; padding: 12px; }
ā also, there's a bit of irregularity in the sizes of different components as the size of the screen changes
HAPPY CODING š
Marked as helpful0@Hyuuga81Posted over 1 year ago@frankuxur thanks for the recommendation. I added one value for the padding and I added transitions to my buttons on hover. It really is easier on the eyes. I still had some problems getting a circle but then I noticed the margin had to be set to 0. There was margin on the inner text of the number buttons. I added a pixel width but hesitated to add a height. I hear that when using flex it isn't advisable, but I need to read up on why in detail. Anyway thanks for taking the time to look at my code and explain so clearly with examples.
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