What are Semantic Elements?
HTML5 Semantic elements are those which clearly describe its meaning to both the browser and the developer. HTML5 semantic elements have meaningful names that tell about the type of content. For example header, footer, table, etc. Many semantic elements are introduced in HTML5 that make the code easier to write and understand for the developer.
The semantic elements added in HTML5 are:
HTML5 <article> Element:
The <article> element is used to define a self-contained, independent content that is intended to be independently distributable or reusable. The content of the <article> element has its own meaning and it can be easily differentiated from the rest of the webpage content.
Possible source for Article Element are :
HTML5 <aside> Element:
The <aside> element is used to define content which is indirectly giving information to the main content of the webpage. It is used to improve an article with additional information and it is frequently represented as a sidebar.
HTML5 <details> Element:
The HTML <details> tag is used to specify additional details that the user can view or hide on demand. It can be used in conjunction with the <summary> tag of HTML5 to provide a heading that can be clicked on to expand/collapse the details as required.
HTML5 <figcaption> Element:
The <figcaption> tag is used to specify a caption for a <figure> element. The <figcaption> is used as a child of <figure> element to give a caption to the table, image or chart. It is used either as the first or last child of its parent <figure> tag.
HTML5 <figure> Element:
The <figure> tag is used to specify self-contained content like diagrams, photos, code listings, etc. The <figure> element can be used to associate a caption together with some embedded content such as graphics or video. The <figure> element can be used in conjunction with the <figcaption> element to give the caption to the contents of the <figure> element.
HTML5 <footer> Element:
The <footer> element is used to define a footer of HTML document or section. The <footer> element contains information about the author of the document, copyright information, links to related documents, etc.
HTML5 <header> Element:
The <header> element is used to represent the header of a document or section. It contains information related to the title and heading of the related content.
HTML5 <main> Element:
The <main> tag is used to represent the main content of the HTML document. It surrounds the main content of the page, content that is unique to that document and it should not contain the duplicated content across multiple webpages such as header, footer, and navigation elements.
HTML5 <mark> Element:
The <mark> element is used to represent text which is marked or highlighted for reference or notation purposes. The text on which mark element has been added is considered to be particularly relevant in a specific context.
HTML5 <nav> Element:
The <nav> element is used to define a block of navigation link, either within the current document or to other documents.
HTML5 <section> Element:
The <section> element is used to define the section in a document, such as chapters, headers, footers or any other sections of the document.
HTML5 <summary> Element:
The <summary> tag is used to define a summary for the <details> element. It is used along with the <details> element to provide a summary visible to the user. The content placed inside the <details> element will become visible when the user clicks the summary.
HTML5 <time> Element:
The <time> element is used to represent a specific period in time which is in a human-readable format. The <time> element may include the datetime attribute to translate dates into a machine-readable format to allow better search engine results.