Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 4 months ago

Responsive Social Links Profile using CSS Flexbox

pure-css, web-components, accessibility
Muhamad Rukhul Kirom•380
@rukhulkirom
A solution to the Social links profile challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

I’m most proud of how clean and well-structured the code is, making it easy to read and maintain. The dark theme with contrasting green accents creates a visually appealing and modern look. Using Flexbox ensures proper alignment and responsiveness, while the smooth hover effects on the social media links enhance user interaction.

Next time, I would introduce CSS variables for colors and avoid redundant styling by grouping common properties. These improvements would make the project more scalable, user-friendly, and easier to update in the future.

What challenges did you encounter, and how did you overcome them?

One of the challenges I encountered was ensuring that the card design remained responsive across different screen sizes. Initially, the card looked great on larger screens, but on smaller devices, some elements felt cramped. To overcome this, I used flexbox to center the content properly.

Another challenge was making the social media links visually appealing while maintaining good accessibility. At first, the hover effect didn’t stand out enough. I refined the styling by adding a background color change and a slight contrast shift, ensuring better user interaction.

What specific areas of your project would you like help with?
  1. Responsiveness & Mobile Optimization – The design looks good on larger screens, but I want to ensure it adapts well to all devices. Are there better CSS techniques I can use to improve responsiveness, especially for very small screens?

  2. Hover & Focus States – I added hover effects to make the buttons more interactive. Do they feel intuitive, or are there improvements I could make to enhance the user experience further?

  3. Code Optimization – I tried to keep my CSS clean, but I feel there might be redundant styles. Are there any ways I can refactor my CSS to make it more efficient and scalable, perhaps using CSS variables or utility classes?

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Emerson-Henrique•50
    @Novicks
    Posted 4 months ago

    Your code is well structured, but you just need to pay attention to some lines that sometimes end up being repeated in your style.css, such as .social-media ul li a or display: inline-block is repeated twice, which ends up being redundant.

    1- For better responsiveness on different screen sizes, I recommend using the @media screen and (min-width or max-width) CSS, which changes part of your application's style at certain width measurements, allowing your application to adapt to different screen sizes. I recommend that you structure your site with the mobile version in mind first, so that when you use the media query to adapt the layout from mobile to computer, it will be easier and simpler to adapt the elements to a larger screen.

    2- The hover and focus states are great, congratulations on your work.

    3- When it comes to optimizing style.css, I recommend that you always try to check if certain lines of code are already found in parent elements of the object you are styling so that there is no code redundancy, but your code in general is optimized and very clean.

  • jdrodriguez2707•170
    @jdrodriguez2707
    Posted 4 months ago

    Hi, @rukhulkirom. I hope you're doing great! Your solution looks really good, you replicated the design very well. Also, I really liked that you used <ul> and <li> elements for the social links list. I actually incorporated them into my own solution thanks to you!

    Here are some tips I can give you according to your requests:

    • About the responsiveness & mobile optimization, the design looks great on all devices! However, you might consider adding some horizontal padding to ensure proper spacing around the card on smaller screens.

    • Another thing to improve is the measurement units you used. Instead of px, consider using rem for better adaptability to different user font sizes. This ensures that your website remains accessible and scales properly. I recommend this article for a deeper understanding.

    • You could also add transitions so the hover effects look more fluid, for example:

    .social-media ul li a {
      display: inline-block;
      width: 100%;
      height: 100%;
      display: inline-block;
      width: 100%;
      color: hsl(0, 0%, 100%);
      padding: 13px;
      text-decoration: none;
      font-size: 14px;
      font-weight: 400;
      border-radius: 8px;
      transition: 0.3s ease;
    }
    

    This is optional, though. The hover effects already look good and interactive.

    • About the code optimization, As you mentioned, adding classes and CSS variables could be beneficial. While they might not seem necessary for small projects, you'll notice a significant difference in larger ones.

    • Also, consider exploring alternative ways to add fonts, such as using @font-face in CSS or the <link> tag in HTML instead of @import. This can improve performance.

    • Finally, I noticed that the profile image looks slightly irregular. You can use the aspect-ratio property to maintain the correct width-to-height ratio, along with object-fit to ensure the image adapts properly without distortion. Here's how:

    .card .profile-card img {
        width: 100px;
        border-radius: 50%;
        aspect-ratio: 1 / 1;
        object-fit: cover;
    }
    

    Make sure to remove the height property so it adjusts automatically. You can learn more about aspect-ratio in the MDN docs

    That's all. Keep up the great work, and happy coding! 🚀.

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