
A list of all HTML tags provides the building blocks needed to create and organise content on the web. In HTML, tags define the start and end of elements, which tell browsers how to structure text, images, links, tables, and forms on a webpage. Understanding basic HTML tags, attributes, and semantic HTML makes web pages easier to read, navigate, and maintain.
From simple elements such as <p> for paragraphs and <h1> for headings to <a> for links and <img> for images, HTML elements give structure and meaning to webpage content. Learning how these elements work, when to use them, and how to write them correctly helps beginners build well-structured webpages and provides a strong foundation for learning CSS and JavaScript.
Before exploring individual HTML elements, it helps to understand how standard HTML syntax works. These basic concepts explain how HTML code is written, how different elements work together, and how browsers interpret the markup.
Knowing the difference between tags, elements, and attributes also makes it easier to understand the examples used throughout this guide. Void elements follow a slightly different syntax because they do not contain content or require closing tags.
Opening and Closing Tags: Most HTML elements use an opening tag (such as <p>) and a closing tag (such as </p>) wrapped around content.
HTML Elements: An element includes the opening tag, the content inside it, and the closing tag.
Attributes: Attributes sit inside the opening tag to provide extra details, such as href in a link or src and alt in an image.
Nesting: Elements can be placed inside other elements, provided inner tags close before outer tags close.
HTML Void Elements: Void elements do not hold content and have no closing tag, such as <br>, <hr>, <img>, <input>, <link>, and <meta>.
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Sample Web Page</title>
</head>
<body>
<h1>Welcome</h1>
<p>This is a simple HTML document.</p>
</body>
</html>
To build strong foundational coding skills, learners can explore practical web development tutorials for step-by-step guidance.
Document and metadata elements define the overall structure of an HTML file and share page details with browsers and search engines. Note that <!DOCTYPE html> is a document type declaration rather than an HTML tag; it tells the browser to render the page using modern HTML standards.
|
Element |
Purpose |
Syntax |
Example |
Status |
|
<html> |
Root container for the entire HTML document |
<html lang="en">...</html> |
<html lang="en">...</html> |
Current |
|
<head> |
Holds page metadata, title, and linked files |
<head>...</head> |
<head><title>Home</title></head> |
Current |
|
<title> |
Sets the page title shown in the browser tab |
<title>Text</title> |
<title>HTML Guide</title> |
Current |
|
<meta> |
Defines metadata like character set and viewport |
<meta name="..." content="..."> |
<meta charset="UTF-8"> |
Current |
|
<link> |
Connects external resources such as stylesheets |
<link rel="stylesheet" href="..."> |
<link rel="stylesheet" href="style.css"> |
Current |
|
<base> |
Sets a default base URL for relative links |
<base href="..."> |
<base href="https://example.com/"> |
Current |
|
<style> |
Embeds internal CSS rules inside the document |
<style>...</style> |
<style>p { color: black; }</style> |
Current |
|
<body> |
Contains all visible content on the webpage |
<body>...</body> |
<body><h1>Hello</h1></body> |
Current |
Looking to build job-ready coding skills? Explore structured web development batches on PW Skills to practice hands-on projects.
Semantic HTML uses meaningful tags to describe the role of each section. Proper semantic landmarks improve accessibility for screen readers and help search engines understand page hierarchy.
<h1> to <h6>: Define six levels of headings, with <h1> as the main page heading and <h6> as the lowest subheading.
<p>: Creates a standard paragraph of text.
<ul>, <ol>, and <li>: Build unordered (bulleted) lists, ordered (numbered) lists, and individual list items.
<dl>, <dt>, and <dd>: Create description lists with terms (<dt>) and descriptions (<dd>).
<strong> and <em>: Mark important text (<strong>) and emphasised text (<em>).
<span>: Acts as an inline container for styling specific text parts.
<br> and <hr>: Insert a single line break (<br>) or a thematic horizontal break (<hr>).
<blockquote> and <q>: Display long block quotations (<blockquote>) and short inline quotes (<q>).
<code> and <pre>: Format inline computer code (<code>) and preformatted text (<pre>).
<header> and <footer>: Represent introductory content and closing footer sections.
<nav>: Groups primary navigation links.
<main>: Encloses the central, unique content of the page.
<section> and <article>: Divide content into thematic sections (<section>) or self-contained posts (<article>).
<aside>: Holds secondary or sidebar content related to the main text.
Looking to build a career as a Full Stack Developer? Explore the PW Skills Full Stack Web Development Course and take the next step towards your career in tech.
HTML provides dedicated tags to connect web pages and display images, audio, video, and external frames cleanly.
|
Element |
Purpose |
Syntax |
Example |
Status |
|
<a> |
Creates hyperlinks to pages or sections |
<a href="url">Text</a> |
<a href="https://www.pw.live/pwskills">Visit PW Skills</a> |
Current |
|
<img> |
Embeds an image with descriptive alt text |
<img src="file" alt="text"> |
<img src="logo.png" alt="Site Logo"> |
Current |
|
<picture> |
Provides multiple image sources for responsive screens |
<picture>...</picture> |
<picture><source srcset="lg.jpg"><img src="sm.jpg" alt="View"></picture> |
Current |
|
<source> |
Specifies media files for <picture>, <audio>, or <video> |
<source src="..." type="..."> |
<source src="clip.mp4" type="video/mp4"> |
Current |
|
<audio> |
Embeds playable sound content |
<audio controls>...</audio> |
<audio controls src="sound.mp3"></audio> |
Current |
|
<video> |
Embeds playable video content |
<video controls>...</video> |
<video controls src="video.mp4"></video> |
Current |
|
<track> |
Adds subtitles or captions to audio and video |
<track src="..." kind="captions"> |
<track src="en.vtt" kind="captions" srclang="en"> |
Current |
|
<iframe> |
Embeds another webpage inside the current page |
<iframe src="url" title="..."></iframe> |
<iframe src="map.html" title="Location Map"></iframe> |
Current |
Including clear alt attributes on <img> tags and <track> captions on <video> tags ensures media remains accessible to all users. Learners can read more technical guides on PW Skills blogs to strengthen core concepts.
Structured data tables and accessible forms allow users to read organised records and submit information smoothly.
<table>: Wraps the entire data table.
<caption>: Adds a descriptive title to the table.
<thead>, <tbody>, and <tfoot>: Group table header rows, body rows, and footer rows.
<tr>, <th>, and <td>: Define a table row (<tr>), a header cell (<th>), and a standard data cell (<td>).
Properly pairing <label> with <input> via matching for and id attributes improves usability and accessibility.
|
Element |
Purpose |
Syntax |
Example |
Status |
|
<form> |
Collects and submits user input |
<form action="..." method="...">...</form> |
<form action="/submit" method="post">...</form> |
Current |
|
<label> |
Labels a form control for clarity and accessibility |
<label for="id">Text</label> |
<label for="email">Email</label> |
Current |
|
<input> |
Creates text, email, password, checkbox, or radio fields |
<input type="..." id="..." name="..."> |
<input type="email" id="email" name="email"> |
Current |
|
<select> |
Creates a dropdown menu of choices |
<select name="...">...</select> |
<select name="city"><option>Delhi</option></select> |
Current |
|
<textarea> |
Provides a multi-line text input box |
<textarea rows="4" cols="30"></textarea> |
<textarea name="notes" rows="3"></textarea> |
Current |
|
<button> |
Creates a clickable button |
<button type="...">Text</button> |
<button type="submit">Send</button> |
Current |
|
<details> |
Creates an expandable widget for extra information |
<details>...</details> |
<details><summary>More</summary><p>Details</p></details> |
Current |
|
<summary> |
Defines the visible heading for <details> |
<summary>Heading</summary> |
<summary>View Answer</summary> |
Current |
|
<dialog> |
Represents a popup modal or dialogue box |
<dialog open>...</dialog> |
<dialog open><p>Saved!</p></dialog> |
Current |
Ready to upskill across in-demand tech domains? Check out all available PW Skills batches and start learning at your pace.
Under the modern HTML standard, elements fall into clear functional groups, while older presentational tags are marked obsolete:
Scripting and Containers: <script>, <noscript>, <template>, <slot>, <div>, and <canvas> handle dynamic scripts, graphics, and generic layout grouping.
Embedded Objects: <embed>, <object>, <map>, <area>, <svg>, and <math> support external media, image maps, vector graphics, and mathematical notation.
Legacy and Obsolete Tags: Older tags such as <font>, <center>, <marquee>, <big>, <strike>, <tt>, <frame>, and <frameset> are deprecated in modern HTML5. Developers should avoid them and use CSS for layout, alignment, and text styling instead.
For learners aiming to build a career in technology, PW Skills offers structured learning paths across modern programming and web technologies.
Understanding HTML tags and elements is the first step towards creating well-structured webpages. From basic text and links to forms, media, semantic elements, and interactive content, each HTML element serves a specific purpose. Learning their uses and syntax helps beginners write cleaner HTML and build a strong foundation for modern web development.
Basic HTML tags include <!DOCTYPE html> (declaration), <html>, <head>, <title>, <body>, headings (<h1> to <h6>), paragraphs (<p>), links (<a>), images (<img>), and lists (<ul>, <ol>, <li>).
or
. An HTML element consists of the opening tag, the content inside, and the closing tag together.