Generally we developers start with
and wrap everything into it .If we need a button, form we just wrap it inside a div class .
Ever wondered if this is really correct ? or there is more to these HTML Elements which could be make code maintainability better .
SEO says " Use Semantic Elements if you want me ππ"
- element - a container where it could be used when there is no specific content and use it for purely styling.
- - a container when there is content marking , grouping of content & needs a common theme styling for that group. Use Section elements when we are mentioning Headings.
- - when the content matters the most , which could be used for blogs, articles, posts.
- 1. Using div for button - Using div elements for buttons is not the efficient way to create a button component whereas the button element gives built in features and enables proper semantics .
- 1. & - Wrapping the input inside label is more improvised usage than just connecting input to label using for.
- 1. & - Both these make the text bold but gives importance to the text and web engine emphasizes readers to focus.
- Improves accessibility of content,
- helps in SEO optimisation.
Thus, using the right HTML elements -
Top comments (0)