Semantics Element in HTML:
Semantic elements in HTML are used to describe the content of a web page in a more meaningful way. They provide a clear structure to the web page, making it easier to read and understand by both humans and machines.
Here are some examples of semantic elements in HTML:
- <header>: This element is used to define the header of a web page or section.
- <nav>: This element is used to define a section of navigation links.
- <main>: This element is used to define the main content of a web page.
- <article>: This element is used to define an independent piece of content, such as a blog post or news article.
- <section>: This element is used to define a section of related content.
- <aside>: This element is used to define content that is related to the main content, but not necessarily a part of it.
- <footer>: This element is used to define the footer of a web page or section.
Using these semantic elements in HTML makes it easier for search engines to understand the content of a web page, improving the page's search engine ranking. It also makes it easier for people using screen readers or other assistive technologies to navigate the page.
Why use Semantic HTML?
Accessibility: Semantic HTML makes webpages accessible for mobile devices and for people with disabilities as well. This is because screen readers and browsers are able to interpret the code better.
SEO: It improves the website SEO, or Search Engine Optimization, which is the process of increasing the number of people that visit your webpage. With better SEO, search engines are better able to identify the content of your website and weight the most important content appropriately.
Easy to Understand: Semantic HTML also makes the website’s source code easier to read for other web developers.
New Semantics Tags in HTML5:
HTML5 introduced several new semantic tags that were not present in previous versions of HTML. These tags provide more descriptive and meaningful information about the content of a web page. Some of the new semantic tags in HTML5 are:
- <article> - used to define a self-contained article or content block
- <section> - used to group related content together
- <header> - used to define the header of a section or page
- <footer> - used to define the footer of a section or page
- <nav> - used to define the navigation section of a website
- <aside> - used to define content that is tangentially related to the main content of a page
- <figure> - used to define self-contained content such as images, videos, or diagrams
- <figcaption> - used to define a caption for a <figure> element
- <main> - used to define the main content of a webpage
- <time> - used to define a specific time or date
- <progress> - used to show the progress of a task or process
- <meter> - used to show a measurement within a known range
- <details> - used to show additional details or information that can be toggled on and off
- <summary> - used to define a summary or title for a <details> element.
These new semantic tags provide developers with more options for creating accessible, structured, and meaningful content on the web.
0 Comments