I’m working on an Angular project and want to ensure that my components follow HTML semantics for both Accessibility and SEO purposes, but only when is need because I don’t want to add extra code.
Using tags like and doesn’t seem critical for:
- Accessibility: Screen readers and assistive technologies primarily rely on content, headings, and other semantic tags like lists or links to convey meaning.
- Semantics within Angular: The component selector itself provide enough context about the content’s purpose.
In this case, using and tags seems more useful for SEO purposes to help search engines better understand the content structure.
In case I need to use a semantic tag, I have discovered that I can limit its purpose using:
selector: 'article [app-publication]'
Arnau Nau Pareja is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.