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 using HTML + CSS (Flex, BEM) questions about spacing + bg

aokβ€’ 140

@kvcarido

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


Hi community!

This challenge was a great way to apply CSS fundamentals and BEM, which I've recently been spending time learning on a deeper level. Overall feedback is greatly appreciated!

Two specific requests for feedback:

  • when using position: relative; to offset .profile-picture img, there's an issue with leftover white space of where the img would originally be positioned in the document flow – looking for a more efficient approach that prevents this awkward spacing!
  • working with the background SVGs threw me a for a loop, as bg-pattern-bottom.svg seems to be causing the page to scroll

Thanks in advanced! πŸ˜„

Community feedback

Felipe OGβ€’ 730

@felipeog

Posted

This comment was deleted

3

aokβ€’ 140

@kvcarido

Posted

@felipeog, thanks for taking the time to look it over and the really insightful feedback πŸ˜„

  • I took your advice and utilized the background-image and respective properties instead of imgs– I initially took this route, but didn't realize how specific I could get with background-position and doubted my intuition. This time around, could I ask your opinion on my updated approach under the html element?
  • Negative margin-top did the trick! Amazing 🀩
  • Understood! With such a simple component I figured I could get away with it, but will keep this in mind going forward especially for bigger challenges!

This has helped tremendously! Appreciate you, Felipe! βœ…

1
Felipe OGβ€’ 730

@felipeog

Posted

Hey, @kvcarido!

I think that the background solution is fine and responsive.

But if you want to go the extra mile, the design has a different size for the background on the mobile version. You can use a @media query to apply different background values for different screen sizes.

Oh, and I forgot to comment on the use of CSS variables before, it is nice!

Keep hacking!

1
P
ApplePieGiraffeβ€’ 30,545

@ApplePieGiraffe

Posted

Hey, aok! πŸ‘‹

Good work on this challenge! Your solution looks quite good! πŸ™Œ

Your HTML is semantic, too (kudos for that)β€”just apply felipeog's great advice, and I think you'll be good to go! πŸ‘

Keep coding (and happy coding, too)! 😁

1

aokβ€’ 140

@kvcarido

Posted

Hi, @ApplePieGiraffe! Thanks so much for taking a look over. πŸ˜„

I applied Felipe's suggestions and I'm quite pleased with the results – in applying the background SVGs, I realized I'd need to add a media query to scale them to look like the mobile example. Any suggestions on fixing that?

Great to hear from you again βœ… Happy coding!

1
P
ApplePieGiraffeβ€’ 30,545

@ApplePieGiraffe

Posted

@kvcarido

The background SVGs are quite tricky to position in this challenge! I suggest simply using a media query to change their position for the mobile layout of the site since that's a nice, simple way to do it. You can also experiment with using vw and vh units to position the background images so that they do not move around when the screen is resized. πŸ˜‰

Keep it up! πŸ‘

1
P
ApplePieGiraffeβ€’ 30,545

@ApplePieGiraffe

Posted

@ApplePieGiraffe

I actually used both vw and vh units and percentages (with the calc function) to position the background SVGs in this challenge, but that might be overkill! Like I mentioned, a simple media query should do the trick. πŸ˜…

Also, I suggest adding the background SVGs to the body (not html), since that's a more common practice and is a little more intuitive (since the body is where all the visible content of the page resides).

1
Tamilselvan Sβ€’ 165

@tamil-hash

Posted

Size the html width 100vw and height 100vh to set the page to screen size and use flexbox , justify content:center, align-items:center to place the content in perfect center.

1

Account Deleted

Why is there a horizontal scroll on the page ? Please look into that. The code can also be improved in ways. You can try flexbox for this.

1

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