HTML5 introduced several new tags and attributes to enhance the structure, semantics, and functionality of web documents.
<!DOCTYPE html>
: This declaration specifies the document type and version as HTML5.<html>
: The root element that wraps all the content on the page.<head>
: Contains meta-information about the document, such as the title, character encoding, and linked resources like stylesheets and scripts.<title>
: Sets the title of the web page, which is displayed in the browser's title bar or tab.<meta>
: Provides metadata about the document, such as character encoding and viewport settings.<link>
: Used to link external resources like stylesheets.<style>
: Embeds CSS for styling the document.<script>
: Embeds JavaScript code or links to external scripts.<body>
: Contains the main content of the web page.<header>
: Represents introductory content for a section or page, typically containing headings and navigation elements.<nav>
: Defines a navigation menu or links within the document.<main>
: Represents the main content of the document, excluding headers and footers.<section>
: Defines a thematic grouping of content within the document.<article>
: Represents a self-contained piece of content, like a blog post or news article.<aside>
: Contains content that is tangentially related to the content around it, like a sidebar.<footer>
: Contains the footer information of a section or page, typically copyright notices and contact information.<h1>
,<h2>
,<h3>
,<h4>
,<h5>
,<h6>
: Heading elements for creating section headings, with<h1>
being the highest level and<h6>
the lowest.<p>
: Defines a paragraph.<br>
: Represents a line break within text.<hr>
: Creates a thematic break or horizontal rule.<a>
: Defines hyperlinks.<ul>
: Creates an unordered (bulleted) list.<ol>
: Creates an ordered (numbered) list.<li>
: Defines list items within<ul>
or<ol>
.<div>
: A generic container for grouping and styling content.<span>
: A generic inline container for styling content.<img>
: Embeds images.<video>
: Embeds video content.<audio>
: Embeds audio content.<canvas>
: Used for dynamic, scriptable rendering of 2D graphics.<form>
: Defines an HTML form for user input.<input>
: Creates form input elements.<textarea>
: Creates a multiline text input field within a form.<label>
: Provides a label for a form element.<button>
: Creates a clickable button within a form.<select>
: Creates a dropdown list within a form.<option>
: Defines options within a<select>
element.<iframe>
: Embeds an inline frame for displaying another web page within the current document.<details>
: Defines additional details that can be toggled open and closed.<summary>
: Provides a summary or caption for a<details>
element.
These are some of the most commonly used HTML5 tags. HTML5 introduced several other tags and attributes to enhance web development, but these cover the essentials for creating structured and semantically meaningful web pages.
Top comments (0)