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

Profile Card Component 🎯 [ SEMANTIC MARKUP - VANILLA CSS3 - BEM ]

accessibility, bem, lighthouse
Abdul Khaliq 🚀•72,380
@0xabdulkhaliq
A solution to the Profile card component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


👾 Hello, Frontend Mentor Community,

This is my solution for the Profile Card Component.

  • Had a lots of fun building this challenge !
  • Got some experience in pagespeed optimization and rapid prototyping the site
  • Scored 100% on Google Pagespeed Insights! 🤩
  • Layout was built responsive via mobile first workflow approach
  • Feel free to leave any feedback and help me to improve my solution (or) make the code clean!

CUSTOM TWEAKS..🚀 :

  • Added smooth hover effect while hovering the card in desktop mode

👨‍🔬 Follow me in my journey to finish all newbie challenges to explore solutions with custom features and tweaks

Ill be happy to hear any feedback and advice!

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Account deletedPosted about 2 years ago

    Hey Mate, good job on this one!

    First, I am curious as to why you have a style tag at the bottom of the file? Normally you can defer noncritical CSS, but seeing as the CSS in this component is essentially everything featured on the page, it is incorrect in this instance to do that. This is also not the correct way to defer CSS.

    You should also use alt tags on images where possible. This assists people who use screen readers to access your content.

    Regarding the CSS, you have quite a few redundant and unnecessary rules. For instance, the width on your ".profile-card" component does nothing. The use of CSS Grid is also completely unnecessary here. Grid is useful for 2D layouts. Seeing as this is a 1D layout, you should use flexbox for this. You also do not need to specify an explicit height on this element, especially using a confusing measurement like "23.2em". What you should do is simply use margins and padding to make the element have the height you need. This is a lot easier and less error prone to do. You also do not need to set overflow: hidden on this element.

    When sizing elements you should simply allow the contents to determine the height, that way you do not need to fight CSS to make your layout work. Padding and margins are your friend here, use them correctly.

    Apart from that great work!

    Marked as helpful
  • Melvin Aguilar 🧑🏻‍💻•61,020
    @MelvinAguilar
    Posted about 2 years ago

    Hello there 👋. Good job on completing the challenge !

    I have some suggestions about your code that might interest you.

    The last commit to the repository was yesterday, so I assume you can still accept feedback.

    • The <picture> tag is primarily used for displaying responsive images, and if you only have one image, the benefits of using <picture> may not be significant.
    • It is generally not recommended to use numbers, such as "80K" or "803K," for heading elements. Headings should be clear and descriptive, conveying the main topic or idea of the content that follows. This is the heading structure of your code:

      • Profile Card Component (h1)
        • Victor Crest (h2)
          • 80K (h3)
          • 803K (h3)
          • 1.4K (h3)

      Does this make sense? In my humble opinion, they are not headings elements. You can read more about this issue here: Accessible heading structure

    • While it's great that you've provided an empty alt attribute for the image, it's not necessary to include aria-hidden="true" if you're also using alt="". This is because the screen reader will ignore the image with an empty alt value.
    • While hover effects can add some visual interest to a component, it's important to use them judiciously. Hover effects on non-interactive elements can confuse users who expect the element to be clickable or interactive.

    I hope you find it useful! 😄 Above all, the solution you submitted is great!

    Happy coding!

  • Eucharia Adaobi•0
    @Euchariaada
    Posted about 2 years ago

    I just started working on some of these projects. I will return here to look at your work later. Weldone.

  • UzzalPahan•95
    @UzzalPahan
    Posted about 2 years ago

    wow very nice

  • MRUFKA755•70
    @MRUFKA755
    Posted about 2 years ago

    How are you doing same height and width as preview?

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 1st-party linked stylesheets, and styles within <style> tags.

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.

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

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