Design comparison
Solution retrospective
First time trying to use BEM CSS naming conventions, any feedback welcomed.
Community feedback
- @MelvinAguilarPosted 12 months ago
Hello there 👋. Good job on completing the challenge !
I have some suggestions about your code that might interest you.
-
When following the BEM naming convention, avoid repeating
__
in class names because only one block name is allowed. For instance, the class name.card__result__message
doesn't follow the pattern: "block-name__element-name" and includes the block namesresult
andmessage
.You can reference an example of this error here: BEM Quick start - Nesting.
- The element
<div class="card__btn">Continue</div>
should be a button and not a div. Since the element has a hover effect and is interactive, it's better to use a button element for accessibility.
I hope you find it useful! 😄 Above all, the solution you submitted is great!
Happy coding!
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