Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Responsive card with JavaScript button interactivity

z-mnβ€’ 150

@z-mn

Desktop design screenshot for the Article preview component coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


What specific areas of your project would you like help with?

Is it better to not use IDs at all? Because I can achieve the same purpose of getElementById with querySelector. Should I use BEM naming convention on IDs? I would also like to know if I have used the BEM convention properly. Any other bits of feedback are appreciated :)

Community feedback

MikDra1β€’ 6,030

@MikDra1

Posted

Using IDs in HTML is still useful because they allow you to quickly and uniquely reference specific elements, especially for JavaScript. While querySelector can do the same thing, getElementById is faster and simpler when you need to select just one element.

Regarding BEM (Block Element Modifier), it’s meant for class names, not IDs. BEM helps keep your CSS organized by using structured class names. Since IDs are already unique and serve a different purpose, there's no need to use BEM with them. It would just make things more complicated.

Hope you found this comment helpful πŸ’—

Good job and keep going πŸ˜πŸ˜ŠπŸ˜‰

Marked as helpful

1

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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