Semantics tags are useful or not

Today I will learn how semantics tags are important to the coder and also website. before telling the advantages of semantics tags we will be known what semantics tags are A semantic element clearly describes its meaning to both the browser and the developer.

Examples of non-semantic elements: <div> and <span> - Tells nothing about its content.

Examples of semantic elements: <form>, <table>, and <article> - Clearly defines its content.

These semantics tags are used when working in a big company because when entering a new company and startup first you have to understand the code of that website and that code is not the proper manner of code and there is clearly defines its content. That time you face issues and working gets slow. That's why we use semantics tags to define the code to increase the readability of the code to that coder can understand the code easily.

Advantages of semantics tags

  1. Improved accessibility: Semantic tags provide context to web content and make it easier for assistive technologies, such as screen readers, to understand and present the content to users with disabilities.

  2. Better SEO: Search engines use semantic tags to better understand the content of a page, allowing for more accurate indexing and improved search rankings.

  3. Consistent structure: Semantic tags provide a standard and consistent way of structuring web content, making it easier for developers to create and maintain websites.

  4. Enhanced readability: Semantic tags improve the readability of web content for both users and developers, making it easier to understand the content and how it should be presented.

  5. Reusable code: Reusing common semantic tags, such as header and footer, across a website can simplify the development process and reduce the amount of code needed.

Disadvantages of semantics tags

  1. increased complexity: Using semantic tags adds complexity to a website's HTML code, which can make it harder to maintain and update.

  2. Browser compatibility: Not all browsers support all semantic tags, which can lead to the inconsistent rendering of a website across different devices.

  3. Overuse: Overuse of semantic tags can make the HTML code cluttered and harder to read, defeating the purpose of using them in the first place.

  4. Misuse: Improper use of semantic tags, such as using them for styling rather than for their intended purpose, can lead to incorrect and inconsistent search engine optimization (SEO) results.

  5. Learning curve: Semantic tags are a relatively new concept and may require time and effort for web developers to learn and understand how to use them effectively.

List of semantics tags

Here's a list of common semantic tags used in HTML and XML:

  1. <html> - the root element of an HTML document

  2. <head> - contains meta-information about the document

  3. <title> - defines the title of the document, which is shown in the browser's title bar

  4. <body> - contains the main content of the document

  5. <header> - contains introductory content or a set of navigational links

  6. <nav> - contains navigation links

  7. <main> - contains the main content of the document, excluding content in sidebars, headers and footers

  8. <article> - defines a self-contained content that can be independently distributed

  9. <section> - defines a standalone section within an HTML document, such as chapters, headers, footers, or any other sections of the document

  10. <aside> - contains content that is tangentially related to the main content, such as sidebars, pull quotes, and other secondary information

  11. <footer> - contains information about the author, copyright information, and other information about the document

  12. <p> - defines a paragraph

  13. <h1> to <h6> - defines headings of different levels, with <h1> being the highest-level heading and <h6> being the lowest-level heading

  14. <ul> - unordered list

  15. <ol> - ordered list

  16. <li> - list item

  17. <img> - embeds an image

  18. <a> - defines a hyperlink

  19. <br> - line break

  20. <hr> - horizontal rule (a thematic break)

This list is not exhaustive and there are many other semantic tags that can be used in HTML and XML.

10
Subscribe to my newsletter

Read articles from Venkatesh Rapolu directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Venkatesh Rapolu
Venkatesh Rapolu