Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Profile card component

#accessibility#lighthouse
P

@andreasremdt

Desktop design screenshot for the Profile card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Hey there,

This is my solution to the profile card component challenge. I've implemented it with basic HTML and CSS.

The solution is completely responsive and focuses on accessibility and pixel-perfect design.

Let me know what you think :)

Community feedback

P

@brunomoleta

Posted

Regarding accessibility, according to MDN:

  • <h1> is the element that describes the content of the page;

That means the h1 of our page shouldn't be the user's name but rather the Profile card of Victor Crest, which is more helpful for screen-readers.

Also, it's a good call to start the bottom part of the card with an h2 with User statistics above it so it gives a good impression about the content to come next. Like <h2>Profile Statistics</h2>.

And then, it would be necessary to hide them in the CSS using: h1, h2 { display: none }

I learned that reading the code from Melvin Aguilar, one of the best-rated devs in the community.

Apart from that, your solution looks fine, Andreas.

Bis später :)

Marked as helpful

0

P

@andreasremdt

Posted

@brunomoleta

Thank you for your reply and helpful information. You are right, putting this sort of information into hidden headings for screen readers would make the solution even more accessible.

One thing though, don't use display: none to hide such elements, as most screen readers will ignore them. Same with the hidden HTML attribute. Instead, there's this technique:

.sr-only {
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
}  

More details and some background information can be found here.

Cheers!

1
P

@brunomoleta

Posted

@andreasremdt

ohhh great to know Andreas, thanks :)

0

Please log in to post a comment

Log in with GitHub
Discord logo

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