HTML
html tags
awasthi sir
8/25/20242 min read
Here's a comprehensive list of common HTML tags and their purposes. This list includes basic tags, as well as some more advanced or less commonly used tags:
Basic Structure Tags
<!DOCTYPE html>: Declares the document type and version of HTML.
<html>: The root element of an HTML document.
<head>: Contains meta-information about the document.
<title>: Sets the title of the document, shown in the browser's title bar or tab.
<body>: Contains the content of the document.
Metadata Tags
<meta>: Provides metadata such as character set, author, and viewport settings.
<link>: Specifies relationships between the current document and external resources (e.g., stylesheets).
<style>: Contains CSS styles for the document.
<script>: Defines client-side JavaScript.
Text Formatting Tags
<h1> to <h6>: Headings, with <h1> being the largest and <h6> the smallest.
<p>: Paragraph.
<br>: Line break.
<hr>: Horizontal rule (line).
<strong>: Strong importance (bold text).
<em>: Emphasis (italic text).
<b>: Bold text (non-semantic).
<i>: Italic text (non-semantic).
<mark>: Highlighted text.
<small>: Smaller text.
<del>: Deleted text.
<ins>: Inserted text.
<sub>: Subscript text.
<sup>: Superscript text.
Lists
<ul>: Unordered list.
<ol>: Ordered list.
<li>: List item.
Links and Anchors
<a>: Hyperlink. <a href="https://www.awasthitech.com">Visit awasthitech.com</a>
<link>: Defines relationships between the current document and external resources.
Images and Multimedia
<img>: Embeds an image. <img src="img_girl.jpg" width="500" height="600" alt="Girl with a jacket">
<audio>: Embeds audio content.
<video>: Embeds video content.
<source>: Specifies multiple media resources for <audio> and <video>.
<track>: Provides text tracks for <video> and <audio>.
Tables
<table>: Defines a table.
<tr>: Table row.
<th>: Table header cell.
<td>: Table data cell.
<caption>: Provides a caption for a table.
<thead>: Group of header content in a table.
<tbody>: Group of body content in a table.
<tfoot>: Group of footer content in a table.
Forms and Input
<form>: Defines an HTML form for user input.
<input>: Defines an input control.
<textarea>: Defines a multi-line text input control.
<button>: Defines a clickable button.
<select>: Defines a drop-down list.
<option>: Defines an option in a drop-down list.
<label>: Defines a label for an <input> element.
<fieldset>: Groups related elements in a form.
<legend>: Defines a caption for a <fieldset>.
Scripting and Programming
<script>: Defines client-side JavaScript.
<noscript>: Defines alternative content for users who have disabled scripts.
Semantic Elements
<header>: Defines a header for a document or section.
<nav>: Defines navigation links.
<main>: Defines the main content of the document.
<section>: Defines a section in a document.
<article>: Defines an independent piece of content.
<aside>: Defines content aside from the main content.
<footer>: Defines a footer for a document or section.
<figure>: Specifies self-contained content.
<figcaption>: Defines a caption for a <figure> element.
Interactive Elements
<details>: Defines additional details that the user can view or hide.
<summary>: Defines a heading for a <details> element.
<dialog>: Defines a dialog box or other interactive component.
Others
<iframe>: Defines an inline frame.
<embed>: Embeds external content (e.g., multimedia).
<object>: Defines an embedded object.
<param>: Defines parameters for an <object> element.