First mobile - Article preview component
Design comparison
Solution retrospective
Any feedback is useful !! :)
Community feedback
- @AlexKMarshallPosted almost 3 years ago
This looks pretty good. The semantics of the HTML are mostly correct too, so well done. There's a few things to take care of.
The share button should be a
<button>
element, not an anchor. Anchors are only for things that go to a different url, not for things that execute javascript.Also, for accessibility, ideally your share popup would close when a user interacts outside of it, not only when they press the share button again. This would be difficult to write yourself, so instead you can use a library like
popper.js
to help.Make sure to not use widths or heights in your CSS. It makes your components inflexible and break under certain conditions. Note if you shrink your screensize down far enough, your design spills out of the sides. And imagine if the text paragraph was twice the length, it would overflow.
Always think about how your component will be used in different spaces, and with different amounts of content. That will make it most robust.
2
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