Design comparison
Solution retrospective
I found using certain CSS properties difficult, but hopefully, I implemented them properly in this challenge. This is my second submission for Frontend Mentor. Feel free to criticize & leave comments that can help me further as I go on this path. I am unsure of my alignments and margin usage. I would also like to know some best practices for IDs and classes. I faced some difficulty trying to implement some of the properties.
Community feedback
- @correlucasPosted about 2 years ago
👾Hello @ubongedem78, Congratulations on completing this challenge!
Great solution and great start! By what I saw you’re on the right track. I’ve few suggestions to you that you can consider to add to your code:
The approach you've used to center this card vertically is not the best way, because using margins you don't have much control over the component when it scales. My suggestion is that you do this alignment with
flexbox
using the body as a reference for the container.The first thing you need to do is to remove the margins used to align it, then apply
min-height: 100vh
to make the body height size becomes 100% of the screen height, this way you make sure that whatever the situation the child element (the container) align the body withdisplay: flex
andalign-items: center
/justify-items: center
.body { min-height: 100vh; background-color: #ecf2f8; padding: 20px; font-family: 'Barlow Semi Condensed', sans-serif; font-size: 13px; display: flex; align-items: center; justify-content: center; }
Something you can do is to improve your html markup using meaningful tags and replacing the divs. In this case, for example the main block/div that takes all the content can be wrapped with
<main>
or section, if you think about = the cards you can replace the<div>
that’s wrapping each card with<article>
you can wrap the paragraph with the quote with the tag<blockquote>
this way you'll wrap each block of element with the best tag in this situation. Note that<div>
is only a block element without meaning, prefer to use it for small blocks of content inside bigger blocks wrapped with some better markup.✌️ I hope this helps you and happy coding!
0 - @kevintataPosted about 2 years ago
Hey! As for IDs and classes I would recommend being more specific with the names to make your life easier. Also using ID's when being used for a single object and classes when you would like multiple objects to share the same css. Example:
<div id="daniel-container"> <article class = "verified-graduate"> <article class = "verified-graduate"> <article class = "verified-graduate"> <article class = "verified-graduate"> <article class = "verified-graduate">Try naming everything with a class or ID so you can have more control over styling.
To get the round edges on each box all you have to do is add a border-radius. (Like you did with the profile pictures but not so big) EXAMPLE: border-radius: 8px;
To make the pictures smaller add a height. EXAMPLE: height: 25px;
Hope this helps!
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