Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted almost 2 years ago

Responsive Social Proof Section using CSS flex-box

accessibility
P
Natalie Smyth•340
@nataliesmyth
A solution to the Social proof section challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


I have been trying to switch from a desktop first approach to mobile first, but with this project I think it ended up making my code more bloated than it would have been. I know it's reasonable for changing your approach to take some time to get used to, but I've been using mobile-first for a few months now and I haven't struggled this much with any other project I've worked on. My question is this: are there certain aspects of a layout design that I can look for in order to decide whether I should start with mobile or desktop, or is this something that becomes easier with time and practice?

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Abdul Khaliq 🚀•72,380
    @0xabdulkhaliq
    Posted almost 2 years 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 or padding.

    • We don't need to use margin and padding to center the component both horizontally & vertically. Because using margin or padding will not dynamical centers our component at all states

    • To properly center the component in the page, you should use Flexbox or Grid layout. You can read more about centering in CSS here 📚.

    • For this demonstration we use css Grid to center the component.
    body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    }
    
    • Now remove these styles, after removing you can able to see the changes
    .container {     <--- Hereafter avoid duplicating styles rules --->
    margin: 2em auto;
    }           
     
    @media (min-width: 1000px)
    .container {
    margin: 2em auto;
    }
    


    • 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 helpful
  • P
    Atif Iqbal•3,320
    @atif-dev
    Posted almost 2 years ago

    Hi, congrats on completing the challenge. Mobile first vs desktop first I also sometimes stumble with this concept. I have heard most people say to pick mobile first but actually, it depends upon the current situations/possibilities we are facing. You can read about the mobile first vs desktop first discussion here

    Hope you will find this Feedback Helpful.

    Marked as helpful
  • Omprakash Rahangdale•900
    @OmprakashR
    Posted almost 2 years ago

    Hi, Congratulations!

    As are you using the flexbox approach, I have some inputs for this

    • in the container .container { text-align: left; margin: 2em auto; }

    you add margin:2em auto for the center container just update it into the margin:0px auto.

    • use for this also for the mobile view .lead-text add margin:0px auto. Or use can use this align-items: center; display: flex; flex-direction: column;.

    for center all components in centered for mobile approach.

    • use this code for a center entire container in the center's body{min-height: 100vh; display: flex; justify-content: center; align-items: center; flex-direction: column;} after adding this use need to add some gap space in .reviews { flex-direction: row; margin-top: 3em; gap: 10px;

    I hope this is helpful to you.

    Thank you!!!!!

    Marked as helpful

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
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit all CSS, SCSS and Less files in your repository.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

How does the JavaScript validation report work?

When a solution is submitted, we use eslint to run an automated check on the JavaScript code.

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub