Social proof section using html, css, grid and flexbox
Design comparison
Solution retrospective
1)I have some doubts with flexbox, when it is in flex-direction:row, that is to say by default, I try to make the elements take the same height and it doesn't work, when I put flex:1 or any other value to the elements, they remain the same.
2)some improvement with respect to the design
Community feedback
- @vanzasetiaPosted about 3 years ago
π Hi Martha!
πGood job on completing this challenge! This solution looks good on both mobile landscape and portrait mode and so on desktop view too! π
Also, you have done a great job on accessibility part where for decorative images (star icons) you add
aria-hidden
and leave thealt
empty. Well done!πI have some feedbacks on this solution:
- Wrap the
blockquote
content withp
tag.blockquote
elementβs content is a quote, not a chunks of characters. Source: HTML best practice github repo - You can import the
Spartan
font family and all the font weights with only one@import
. - Use
rem
or sometimesem
units for font size. Usingpx
won't allow the users to control the font size based on their needs. - Instead of keep setting different
width
for themain
element, I would recommend to set amax-width
withrem
unit to prevent it from keep getting bigger on bigger screen. - For the testimonial card HTML markup, you already have a good markup. But I would prefer to include everything inside the
figure
element. So, it's up to you, whether you follow the Raymart, me, or leave it as it is.
<figure> <figcaption> (flex) <img src="/michael.png" alt="Michael" /> <div> <p>Michael</p> <p>Verified</p> </div> </figcaption> <blockquote> <p> ...quotes </p> </blockquote> </figure>
That's it! Hopefully this is helpful!
Marked as helpful1@Mtc-21Posted about 3 years ago@vanzasetia Hi, I really appreciate you sharing your knowledge, apply the suggestions.
- I usually use rem in the font-size, I don't understand what happened to me.
- the max-width at the container in rem is great
- I did not know those uses of the figure tag
thank you π
0 - Wrap the
- @pikapikamartPosted about 3 years ago
Hey, awesome work on this one. Layout in desktop looks great it is responsive and the mobile state looks great as well.
For your queries:
- By default as well, when using
display: flex
all items inside the row gets the same height since it uses as defaultalign-items: stretch
which makes the tallest element, share that height to its siblings. Now onflex-direction: row
flex: 1
only makes the element of the flexbox be equal in terms of width and not height. If it isflex-direction: column
then it goes to height. - I think the design/layout is already great.
Some suggestions on the site would be:
body
does not needflex-direction: column
since there is only one direct child it has.- I wouldn't really use
ul
on the stars, instead if I were to do this, I would use theli
element'sbackground
props and put all those 5 stars in there. By doing that, I avoided creating extra html tags. - When wrapping a text-content do not just use
strong
to wrap it, use meaningful element like ap
tag if it just a regular text or heading tag if it is an heading. - For each of the testimonial cards, it would be great to use this markup:
<figure> <img src="" alt=""> <blockquote> {qoute in here} </blockquote> <figcaption> person name <p> person role </p> </figcaption> </figure>
Then you could just use
grid
to place each item in their own spot.Aside from those, great job again on this one.
Marked as helpful1@Mtc-21Posted about 3 years ago@pikamart Hi, I really appreciate you sharing your knowledge, apply the suggestions.
- the stars was great, I hadn't thought of that.
thank you π
1 - By default as well, when using
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