79357171

Date: 2025-01-15 05:52:56
Score: 1.5
Natty:
Report link

The basic answer to whether to add a class to main is no. As you correctly noticed, according to the WHATWG specification, there can only be one tag per document (the currently visible one), so adding a class is redundant (even for BEM). Personally, when developing, I try to avoid even styling the main tag. But if I really need to style it, then I actually use main {}, since it's better than creating extra containers to avoid unnecessary DOM nesting.

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: basic_layout