Design comparison
Solution retrospective
Hi folks!, i need feedback on this challenge, how do you thing between the design and the implementation ?
Thank You for @pikapikamart, give me the bests practice and reducing @media rules, and i've updated my solution base on the suggestions
Community feedback
- @pikapikamartPosted almost 3 years ago
Hey, awesome work on this one. The layout of course at desktop state is wider than the design and reducing it would be really nice. Also, I saw that there are other usages of
@media
on this one. I think you could do this challenge without using the@media
since there aren't really anything to be changed. You just need to set a singlemax-width
on the card and that's it.For some other suggestions, here are some:
- Avoid using
height: 100%
orheight: 100vh
on a large container like thebody
orhtml
as this makes the element's height capped based on the viewport/screen's height. Instead usemin-height: 100vh
so that the element will expand if it needs to. - Instead of applying the blue
background-color
in themain
tag, apply it on thebody
tag so that the full height of the screen will contain thebackground-color
. - The
.page__wrapper
is using aheight: 100vh
as I said, avoid usage ofvh
unit in theheight
in general. - When using
img
tag, do not forget to add thealt
attribute, whether the value is empty or not. Because by not including it, screen-reader will instead read the source path of the image which you don't want. So always include it. - The person's
img
could use the person's name as thealt
value since it is already present and it makes sense to add so because this component is all about the person. - For the
.card__footer
, if you look at the content inside that section, you may notice that those are "list" of information about a specific user. Using eitherul
ordl
would be nice on this one and I prefer usingdl
on it. You could go with a markup something like:
<dl> <div> <dt>Follower</dt> <dd>80k</dd> </div> </dl>
A
div
is a valid direct child ofdl
tag. Thedt
should be the text at the bottom part and not the number, so to reverse the placement. Use:display: flex; flex-direction: column-reverse;
On the
div
that contains thedt
anddd
tag.- Lastly, maybe coming up on a solution where you don't need to use
@media
on this one. Using@media
many times is not wrong but if you don't really need it, then don't, just make the layout responsive:>
Aside from those, great job again on this one.
Marked as helpful0@WijayaacPosted almost 3 years ago@pikapikamart Hey, Thank You for your suggestions, i never heard about <dl>,<dd>, and <dt> tag before, but i wanna use it in this project, as you said using @media too often make me not creative with the solution, and again Thank You for your suggestions, it's really help me to improve and use the best practices
1 - Avoid using
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