Design comparison
Solution retrospective
I was facing problems in making profile card centred on screen by setting margins around it and also in font size of Followers, Likes and Photos at last.
Community feedback
- @hagureshinmaPosted almost 4 years ago
Hi Prayanshu!
Good attempt, i recommend to you to read about html markup and semantics, an then try to improve your solution. Also i'm not sure about your desicion to make the card children of the background container element.
There are several ways to center content, you can apply "auto" to the left and right margins (if the width is less than 100%). If you set the container to "display: flex" then use the properties "align-items" and "justify-content" set to center. for an image you can set the display to block and in the parent set align-text to center as well.
The base font size for the web is 16px, so 1em and 1rem are that normally, you can read about it to understand better how it works and the difference between rem and em.
I strongly sugest to eliminate the "style" from the html in "user-details-title>p", just asign a class to the elements and handle the styles in the css.
Happy coding!
1
Please log in to post a comment
Log in with GitHubJoin 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