Design comparison
Solution retrospective
Though it's relatively easy, it costs me one day (6h+) to complete this challenge.
Community feedback
- @pikapikamartPosted almost 3 years ago
Hey, really nice work on this one. The desktop layout looks really great, the site is responsive and the mobile state looks really great as well.
Here are some suggestions for the site:
- Don't use
position: absolute
a very large element. If you inspect your layout, hover on eitherhtml
orbody
tag, you will notice that it has no height since its element is beingabsolute
. Since you are just using this to center the layout, it would be much better to do it this way. But first, remove these stylings on themain
andfooter
:
position top left transform
Then on the
body
tag, just add:align-items: center; display: flex; flex-direction: column; justify-content: center; min-height: 100vh;
You add a
gap
as well if you want to have a spacing between the card and thefooter
.- You don't need the
section
on it though since you already have aarticle
tag inside it. It will just create an extra landmark navigation using screen-reader, thearticle
is enough on this one. - The person's
img
could just use the person's name and you can remove theavatar
word. - When wrapping up a text-content, make sure that it is inside a meaningful element like
p
tag or heading tag and not using likediv, span
to wrap the text. - For the share-toggle, you should have not set the
display: none
on thebutton
. Remember that interactive component needs to use interactive element. By using only adiv
as toggle, you are excluding lots of user because only mouse could interact with it. Style thebutton
to look like that toggle. - If you used
button
, it should have eitheraria-label
attribute orsr-only
text inside it which defines what thebutton
does. It could be something likearia-label="share on social media dropdown"
. - The
button
as well should have a default ofaria-expanded="false"
attribute which will be set totrue
if the user toggles thebutton
and vice-versa. - The
img
inside the toggle is only a decorative image. Decorative images should be hidden for screen-reader at all times by usingalt=""
andaria-hidden="true"
to theimg
tag or onlyaria-hidden="true"
if you are usingsvg
instead ofimg
tag. - As I suggested the usage of
flexbox
to center the layout, the social-media-dropdown is out of place. For this one, I would prefer to make a container, a relative container, which will nest thebutton
toggle and the dropdown so that it will be properly controlled. - Those social-media links could be inside a
ul
element since those are "list" of links. - Each
a
tag that wraps the social-media icon should have eitheraria-label
attribute orsr-only
text inside it, defining where the link would take them. For example, you should usefacebook
as the value if the link would take the user to facebook. - Social-media image should be hidden since it is only a decorative image so use
alt=""
andaria-hidden="true"
.
Aside from those, great job again on this one.
Marked as helpful1@effycocoPosted almost 3 years ago@pikapikamart thank you so much for your detailed feedback. I have fixed most of the problems according to your advice. It's nice to have people like you in this community.
1 - Don't use
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