Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 3 years ago

profile-card-component using React, Flexbox, and SASS.

react, sass/scss
obasekiosa•120
@obasekiosa
A solution to the Profile card component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


I know a few already but any suggestions on where I can learn how to work with images and units in more detail.

This project really tested my understanding of images, positioning(absolute especially) and sizing units (relative units especially). I stumbled and stumbled a lot. Realized there is so much to learn.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Raymart Pamplona•16,040
    @pikapikamart
    Posted over 3 years ago

    Hey, really nice work on this one. The overall layout looks great.

    Here are some suggestions for the site:

    • For this one or just in general, when you building a site, always have a single main tag to wrap the main-content of that page. For this one, the .main should be using a main tag instead of div so that the site will contain a main-landmark.
    • Those 2 blobs images could be used as background value. This way, you won't have to create those 2 div.
    • For the div that wraps the .attribution, use footer tag on it so that it will be nested inside in another landmark. So on this page, you would have a markup that looks something like this:
    <main />
    <footer />
    
    • Remove the position: absolute on the .main since it is not needed, this just hides the .attribution as well. Remove the position: relative from the div that wraps the .attribution. For this, you don't really need them. So you will have to remove the stylings:
    position
    left
    bottom
    

    Since the .App is using a flexbox already to center both items.

    • Also on the .App, remove the height: 100vh. Avoid using height: 100vh on a large container as this makes the element's height capped based on the viewport/screen's height. Instead use min-height: 100vh so that the element will expand if it needs to.
    • For this one, since the layout is showing a person's information and statistics, it makes sense to use the person's name as the person's img alt value.
    • You could use for now the h1 to wrap the person's name since a single h1 is needed for a site. If you feel like h1 is not suited on this, use h2 on the name and have a search about sr-only h1.
    • When wrapping up a text-content, make sure that it is inside a meaningful element like p tag or heading tag and not using like div, span to wrap the text.
    • For the .stats selector, if you look at the content of that part, those are "list" of information about the user, it would make sense to use a ul or dl tag in that one.

    Aside from those, great job again on this one.

    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 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