Fifth and current version of the hypertext markup language for structuring and presenting content for the World Wide Web.
HTML5 is the latest version of HTML, the language used to structure content on the web. It introduces a number of new elements that provide more flexibility and semantic clarity in structuring HTML content. This article will provide an overview of these new elements and how to use them.
Semantic elements are those that clearly describe their meaning to both the browser and the developer. HTML5 introduced several new semantic elements to allow for clearer code structure and improved accessibility. Here are some of the most commonly used:
<header>
: This element represents a container for introductory content or a set of navigational links. It typically contains the section's heading, but can also contain other elements like a logo, search form, and so on.
<footer>
: This element represents a container for the section's footer. A footer typically contains information about the author, copyright information, and links to related documents.
<article>
: This element represents a self-contained composition in a document, page, application, or site, which is intended to be independently distributable or reusable.
<section>
: This element represents a standalone section of a document, which typically includes a heading and additional content related to the heading.
<nav>
: This element represents a section of a page that contains navigation links that appear on the site.
<aside>
: This element represents a section of the page with content that is tangentially related to the content around it, and which could be considered separate from that content.
HTML5 also introduced elements to make it easier to include multimedia content in web pages:
<audio>
: This element is used to embed sound content in documents. It can contain one or more audio sources, represented using the src
attribute or the <source>
element.
<video>
: This element is used to embed video content in a document. It can contain one or more video sources, represented using the src
attribute or the <source>
element.
<embed>
: This element provides an integration point for an external application or interactive content.
<source>
: This element is used to specify multiple media resources for <picture>
, <audio>
, or <video>
.
HTML5 also introduced new input types, attributes, and elements for forms to create more user-friendly web forms. Some of these include:
email
, tel
, url
, search
, range
, color
, etc.placeholder
, required
, autocomplete
, autofocus
, etc.<datalist>
, <output>
, etc.These new HTML5 elements provide more options and flexibility for structuring web content, making it easier to create more complex and interactive web pages. As always, remember to use these elements appropriately and keep in mind the importance of semantic HTML for accessibility and SEO.