Responsive Profile Card using HTML, CSS, and Google Fonts
Design comparison
Solution retrospective
I'm proud of the responsive design and smooth hover effects using Flexbox. Next time, I'll focus on improving accessibility and adding more refined media queries.
What challenges did you encounter, and how did you overcome them?One challenge was centering the content perfectly, which I solved using Flexbox. Another was ensuring responsiveness, addressed by testing and adjusting the layout for different screen sizes.
What specific areas of your project would you like help with?I'd appreciate feedback on improving accessibility, particularly for screen readers, and suggestions for optimizing the responsive design across various screen sizes. Additionally, any tips on enhancing the hover effect interactions would be helpful.
Community feedback
- @geomydasPosted about 1 month ago
- use a css reset
- don't use the global selector for everything. see why
- replace the
.container
div with a main tag instead. more info can be found here - never ever set font-sizes and typography-related properties in px. see why
- wrap the social-links inside a list item. put all of the list items in a list. pretty self-explanatory to see why you would use lists for this. applies to other stuff too but quite a common pattern indeed.
- the image should have better alt text. profile picture describes nothing and you can use "Close-up image of [name]". sometimes you dont need to set an alt text to it as it is just purely decorative
- consider self hosting your fonts for better performance. using google fonts is slower and worse for privacy as it violates gdpr laws. it may not be an issue for this site but on larger, enterprise websites you can get sued for that.
- avoid descendant selectors if possible as it increases the specificity which makes your css harder to override in the long run. for exampl
.social-links .btn:hover
is an example of descendant selectors - take a look at the bem methodology
- use min-height on the body instead of height. try using it on smaller devices and you can see that the content gets cut off and you are unable to scroll
- the .container div in your css does nothing at all. it is already being centered by the body. i don't see why you would need to use flex properties here. remove the flex properties and merge the styles with your
.profile-card
element. this doesn't need a media query at all. you can just use padding instead of centering the element in .container
Marked as helpful1 - @kaamiikPosted about 1 month ago
Hi. Congrats for doing this challenge. I have some notes I wanna mention:
-
I think It's better to add a body font-size to your
body
in the CSS and withrem
then add other font-sizes for headings and ... also inrem
too. You are now saying with*
that every element have a14px
font-size that is not true and is not needed. -
Using
min-height: 100vh;
is better to use because 100vh means 100% of the viewport height, if the content is bigger it will overflow. You should rather use min-height: 100vh, it has a minimum dimension of 100vh but can grow as needed. -
Headings by default have bold font-weight and you can delete
font-weight: 700
from your css. -
For the link items, You can use
ul
withli
for each link. It's more semantic than usingdiv
that is not semantic. Semantic tags is better for accessibility and make your page more robust and clean.
Marked as helpful0 -
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