Semantic HTML tag using, Sass, BEM className

Solution retrospective
I'm not sure about my BEM announcement and my HTML usage. I really want to get some suggestions on it. If you could give me some advice, I will really appreciate you. 🙂
Please log in to post a comment
Log in with GitHubCommunity feedback
- @NaveenGumaste
Hay ! Good Job Wei Kai
These below mentioned tricks will help you remove any Accessibility Issues
-> Add
Main
tag after body like it should be your container. For 1st heading orh1
tag, use header tag and then inside the header put yourh1
orh2
etc . But use header tag only once in main heading element.Keep up the good work!
Marked as helpful - @grace-snow
Hi
You’re definitely misunderstanding semantic html elements here. This is one piece of content. It can be a main element for the card or nest a div/article inside that if you want. Nothing else, and no aside needed
The figure element is not for wrapping all images. You only use figure when the content needs/ deserves a caption
The paragraph in the card is a paragraph not a h3
Every element that has a hover effect in a design means it is interactive. That means you must use interactive elements in these places. In this challenge that’s anchor tags wrapping the image, inside the heading, and wrapping the authors name. Essential.
I can’t see any of the interactivity (hover styles) because those elements are missing, but beyond that another styling issue is that the card is hitting all screen edges on my phone. It needs either a little margin around it, or some padding on it’s wrapper / body element
I hope this helps
Marked as helpful - @MikeBish13
Nice job on the solution!
Some feedback regarding your use of BEM and semantic HTML.
When using BEM, just be careful of the nesting of components. For example, in one section you have card__info-title and card__info-describe. Not only can this naming convention be confused for a modifier (--title, --describe) it can also get messy and complicated very quickly. See if you can create higher level components instead and then try and re-use them throughout the entire project, adding modifiers where needed. For example, these two components could easily have been changed to card__title and card__text. This article does a great job of explaining and solving some of the pitfalls of BEM - https://www.smashingmagazine.com/2016/06/battling-bem-extended-edition-common-problems-and-how-to-avoid-them/
As for semantic HTML, you've done a great job overall and this is a brilliant habit to get into. My advice would be to try not using a semantic element for the sake of it, and if in doubt always check the MDN docs for the full definition to see if it matches your intention. For example, I would argue that you don't really need <aside> in your article as the info in question is a crucial part of the card, rather than something indirectly related. Similarly, I would argue that <time> should be reserved for specific times or dates that could be supported by a datetime attribute, e.g 7 July, 20:00, 2h30m.
Hope that helps.
Marked as helpful - Account deleted
Hi there 👋
Congratulate on finishing your project 🎉. You did a great job 🔨
I give some suggestions that I hope help you take your project to the next level 📈.
- Let's fix the background color. It does not look like the original design. Use this color for background
0D1A2D
- And as Naveen said don't forget to fix accessibility issues 👍
Happy coding ☕ Maqsud
Marked as helpful - Let's fix the background color. It does not look like the original design. Use this color for background
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