Design comparison
Solution retrospective
First time using JS in a project. For some reason the button for desktop version doesn't work. Feedback is appreciated
Community feedback
- @mickygingerPosted over 3 years ago
Hello! 👋
The reason your button is not working is because the styling is moving it before it can receive the mouse click.
Because you've added
margin: 0; padding:0;
to any element that is:active
it overrides the element styling because:active
is more specific that non-active.I would recommend removing
*:active
from your CSS here: https://github.com/Baidya450/article-preview-component/blob/main/styles.css#L9-L13, the box-sizing, padding and margin should not be affected because it has already been set using the*
selector.Finally I would not recommend using a
div
as a clickable element because it is not accessible. I would change the.arrow
to abutton
. You will need to setborder: none;
and a background color to remove the default button styles.Hope that helps!
Marked as helpful1 - @ericsalviPosted over 3 years ago
Hey,
The issue has to do with line 9 in your CSS. You are targeting your wildcard selector by including
*:active
but you most likely meant to use*:after
instead.Fix that and you should be good to go.
Keep pushing yourself for my JS challenges!
Marked as helpful1
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