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

Tanobia 90

@Tanobia

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


I am not sure if using positioning was the right step even tho it gave me the result I wanted. Any different methods and feedback is appreciated.

Community feedback

vintech05 370

@vintech05

Posted

Greetings Tanobia,

Congratulations on completing this challenge! One thing to appreciate though, is that your code looks easy to read! but also I believe there is a bit of CSS overengineering here...

instead of repeating yourself with multiple lines of border-radius, you can simply use CSS one-liners such as

border-radius: top right bottom left;

last thing, you don't want to stress yourself with positioning, especially for the avatar. this is when pseudo-class comes into play:

.avi {
border: solid 5px;
border-radius: 50%;
border-color: aliceblue;
position: relative;
}

.avi::before {
content: ' ';
top: 0;
left: 0;
position: absolute;
background-image: url(/images/card-bg);
width: 100%;
height: 50%; //this one may vary so feel free to explore the height yourself!//
}

so make sure the bg-image is inside the avatar! and the rest of it is going to be a cakewalk.

I hope this helps

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