Design comparison
Solution retrospective
I'm proud of quickly I was able to do this challenge compared to my other ones. It helped to go back and do this (one of the easier ones) before continuing the harder challenges I had started like the FAQ accordion.
What challenges did you encounter, and how did you overcome them?I couldn't figure out a great way to center the card on the verical axis. I ended up using margin-top: 5%;
but I imagine there's another way to do this with flexbox. I tried this:
body {
display: flex;
flex-direction: column;
align-items: center;
height: 100vh;
}
but the card was still sticking to the top for some reason.
What specific areas of your project would you like help with?I would love to know if there's a better way to have the card centered vertically than using margin-top.
I also would like feedback on accessibility ways to make my CSS more efficient. One thing I was wondering was what to write for alt text for the authors profile picture. Would people using screen readers like me to describe the person in the profile picture or would that just be a nuisance? Is there a way to provide more information, like a description of the author, where people using screen readers can access it if they choose to but it's not in the way?
Community feedback
- @sruthiganjamPosted 6 months ago
Add
justify-content: center
to the style. It aligns the blog card to the center0 - @rvupmo33Posted 6 months ago
Hi your card looks so good!
The way I centered my card was by using: (though this isn't using flexbox)
position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
The tutorial below shows you the code in action!
CSS - How to center element using CSS transform property and translate function
If you want a solution using flexbox: 4 Quickest Ways to Center Div with CSS
Hope that helped :)
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