HTML Semantic

HTML semantics refers to using appropriate HTML elements to give meaning and structure to the content of a webpage. By using semantic elements, you provide context and convey the purpose of different parts of your document to both the browser and the developers who may be reading or interacting with your code.

Here are some commonly used semantic HTML elements and their purposes:

1. `<header>`: Represents the introductory content or a container for a group of introductory content at the top of a webpage.

2. `<nav>`: Represents a section of a webpage that contains navigation links.

3. `<main>`: Represents the main content of a webpage, excluding headers, footers, and navigation sections.

4. `<article>`: Represents a self-contained composition in a document, such as a blog post, news article, or comment.

5. `<section>`: Represents a standalone section within a document, such as chapters, tabs, or tabbed content.

6. `<aside>`: Represents content that is tangentially related to the main content, often used for sidebars, pull quotes, or advertisements.

7. `<footer>`: Represents the footer of a webpage or a section at the bottom of a document, typically containing information about the author, copyright, or links to related documents.

8. `<figure>` and `<figcaption>`: Used together to represent self-contained content, such as images, diagrams, or videos, along with their captions.

9. `<time>`: Represents a specific time or a range of dates.

10. `<mark>`: Represents highlighted or marked text within a document.


By using these semantic elements appropriately, you enhance the accessibility, search engine optimization, and maintainability of your HTML code. Additionally, semantic HTML helps assistive technologies, like screen readers, to better understand and present the content to users with disabilities.

Remember to use semantic elements based on the meaning and purpose of the content, rather than relying solely on visual styling. This ensures a clear and meaningful structure for your webpage, benefiting both humans and machines interacting with your code.



About the Author



Silan Software is one of the India's leading provider of offline & online training for Java, Python, AI (Machine Learning, Deep Learning), Data Science, Software Development & many more emerging Technologies.

We provide Academic Training || Industrial Training || Corporate Training || Internship || Java || Python || AI using Python || Data Science etc





 PreviousNext