Responsive social proof section using css grid

Solution retrospective
Hello, Frontend Mentor ?
I just completed this social proof section challenge using CSS grids.
I have an issue with the background-bottom image. It is not displayed. The thing I discovered while debugging my CSS code is that when I removed the absolute position property on the body element, which I used along side the display table to vertically align the content of my page, the background image would show. and when I set the position to absolute, the background image at the bottom will disappear.
I have tried other methods such as flex and grid in trying to align the content of my page vertically and none of them seem to be working. That's why I had to go with the table method, which requires absolute positioning.
Any suggestions on how I can solve this issue would be highly welcome. Thank you.
This is the link to my repo : https://github.com/ovie-best/Frontend-Mentor---Social-proof-section-solution.git
Please log in to post a comment
Log in with GitHubCommunity feedback
- @md5dalton
Greetings Oviedev 👋
I did play around with CSS flex box and grid to place your content in the center of the page and both work perfectly fine. Below is a snippet of CSS I used and I commented out the properties that you should remove.
body { display: grid; place-content: center; min-height: 100vh; /* display: table; */ /* position: absolute; */ /* height: 100%; */ /* width: 100%; */ }
Regarding the background images, I'll leave below a starting point where you can also play around and see how you can place those images the way you want and I'll also comment out properties that are unnecessary :
body { background-position: top left, 50vh bottom; background-repeat: no-repeat; /* background-size: auto, cover; */ }
Happy coding. 👌
Marked as helpful - @correlucas
👾Hello @ovie-best, Congratulations on completing this challenge!
You did a really good work here putting everything together, something you can improve its your code html markup and semantics. You can replace the
<div>
that wraps 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. Pay attention that<div>
is only a block element without meaning.This article from Freecodecamp explains the main HTML semantic TAGS: https://www.freecodecamp.org/news/semantic-html5-elements/
✌️ I hope this helps you and happy coding!
Marked as helpful - @vanzasetia
Hi, Oviedev! 👋
Congratulations on completing this challenge! 🎉
It looks like you had solved the issues. So, I will just give some suggestions to improve this solution.
- There should not be text in
span
anddiv
alone whenever possible. Instead, wrap the text with a meaningful element like a paragraph element. - Hover effects on the non-interactive elements may confuse your users. They might think those elements are interactive elements. Interactivity should only be for interactive elements such as buttons or links.
- Also, transitions and animations should be disabled when the users prefer not to see them. I recommend wrapping the transitions and the animations with the
prefers-reduced-motion
media query.
@media (prefers-reduced-motion: no-preference) { /* animations and transitions */ }
- Not every image needs alt text. If the image does not provide any meaningful content, such as the star icons, consider using empty alt text (
alt=””
). This saves your screen reader users time as they navigate the page.
That's it! I hope this helps! Happy coding! 😄
Marked as helpful - There should not be text in
Join 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