<table> <tr> <th>Name</th> <th>Age</th> </tr> <tr> <td>Alice</td> <td>25</td> </tr> </table>
<meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<a href="https://example.com">Visit Example</a>
<img src="image.jpg" alt="Description of image">
<head> <title>Page Title</title> <link rel="stylesheet" href="styles.css"> </head>
<ul> <li>Item 1</li> <li>Item 2</li> </ul> <ol> <li>First</li> <li>Second</li> </ol>
<title>My Website</title>
<a href="https://example.com">Visit Example</a>
<div>Block Element</div> <span>Inline Element</span>
Line 1<br>Line 2
<header></header> <nav></nav> <article></article>
<table> <tr> <th>Name</th> <th>Age</th> </tr> <tr> <td>Alice</td> <td>24</td> </tr> </table>
<b>Bold Text</b> <strong>Strong Text</strong>
<div>This is block</div> <span>This is inline</span>
<video controls> <source src="video.mp4" type="video/mp4"> </video>
<body style="background-color:lightblue"> Content here </body>
<p>This is <strong>important</strong> text.</p>
<p>This is <em>emphasized</em> text.</p>
<p title="This is a tooltip">Hover over me</p>
<div id="header">Unique ID</div> <div class="box">Shared class</div>
<a href="https://example.com" target="_blank">Open in new tab</a>
<form action="submit.php" method="post"> <input type="text" name="name"> <input type="submit" value="Submit"> </form>
<input type="text" placeholder="Enter your name">
<input type="text" name="username">
<input type="checkbox" name="subscribe"> Subscribe
<input type="radio" name="gender" value="male"> Male <input type="radio" name="gender" value="female"> Female
class
attribute is used to define a group of elements, while id
uniquely identifies a single element on the page.
<div class="container">...</div> <div id="header">...</div>
<iframe>
tag with the YouTube video URL in the src
attribute.
<iframe width="560" height="315" src="https://www.youtube.com/embed/VIDEO_ID" frameborder="0" allowfullscreen></iframe>
data-
.
<div data-user-id="12345">User Info</div>
<form>
tag with input elements to collect user data.
<form action="/submit" method="post"> <input type="text" name="username" placeholder="Username"> <input type="submit" value="Submit"> </form>
<section>
tag defines a thematic grouping of content, usually with a heading.
<section> <h2>About Us</h2> <p>Some info here...</p> </section>
<link>
tag in the <head>
to link to a favicon image.
<link rel="icon" href="favicon.ico" type="image/x-icon">
<div>
is a block-level element used for grouping, while <span>
is inline and used to style part of text.
<div>Block content</div> <span>Inline content</span>
<tr onclick="location.href='page.html';"> <td>Clickable Row</td> </tr>
<label>
tag defines labels for input elements, improving accessibility and usability.
<label for="email">Email:</label> <input type="email" id="email" name="email">
<script>
tag with the src
attribute to include external JavaScript files.
<script src="script.js"></script>
<strong>
indicates importance and is semantic, while <b>
just styles text bold without meaning.
<strong>Important</strong> <b>Bold Text</b>
<meta charset="UTF-8">
tag inside the <head>
to specify encoding.
<meta charset="UTF-8">
<input type="text">
creates a single-line input, while <textarea>
is for multi-line text input.
<input type="text" name="name"> <textarea name="message"></textarea>
<select>
element with <option>
elements inside a form.
<select name="cars"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> </select>
<nav>
element represents a section of navigation links.
<nav> <a href="#home">Home</a> <a href="#about">About</a> </nav>
<article>
element represents a self-contained composition, such as a blog post, news article, or forum post.
<article> <h2>Blog Title</h2> <p>Blog content here...</p> </article>
img { max-width: 100%; height: auto; }
<footer>
tag defines a footer section for a document or section, often containing copyright, links, or author info.
<footer> <p>© 2025 My Website</p> </footer>
<!-- This is a comment -->
<iframe>
tag embeds another HTML page or external content inside the current page.
<iframe src="https://example.com" width="600" height="400"></iframe>
<ul>
tag for unordered lists and <li>
for each item.
<ul> <li>Item 1</li> <li>Item 2</li> </ul>
<em>
emphasizes text semantically (usually italics), while <i>
styles text italic without semantic emphasis.
<em>Emphasized</em> <i>Italic</i>
<a>
tag with the href
attribute.
<a href="https://www.example.com">Visit Example</a>
<meta>
tag provides metadata like charset, description, keywords, and viewport info to the browser.
<meta name="viewport" content="width=device-width, initial-scale=1">
<img>
tag with the src
and alt
attributes.
<img src="image.jpg" alt="Description" width="300">
class
is used to assign styles or behavior to multiple elements, while id
uniquely identifies a single element.
<div class="box">Multiple</div> <div id="unique">Single</div>
<style>
tag within the <head>
section.
<style> body { background-color: lightblue; } </style>
<nav>
element defines a section with navigation links, such as menus or tables of contents.
<nav> <a href="#home">Home</a> <a href="#about">About</a> </nav>
<table>
, <tr>
, <th>
, and <td>
tags to create tables.
<table border="1"> <tr> <th>Name</th> <th>Age</th> </tr> <tr> <td>Alice</td> <td>30</td> </tr> </table>
<div>Block element</div> <span>Inline element</span>
<form>
element collects user input and submits it to a server.
<form action="/submit" method="post"> <input type="text" name="username"> <input type="submit" value="Submit"> </form>
target="_blank"
attribute inside the <a>
tag.
<a href="https://example.com" target="_blank">Visit Example</a>
<article>
element represents a self-contained, independent piece of content.
<article> <h2>Blog Post Title</h2> <p>Blog post content here.</p> </article>
<!-- comment here -->
to add comments.
<!-- This is a comment -->
alt
attribute provides alternative text for images.
<img src="image.jpg" alt="Description of image">
<section>
is semantic, grouping related content; <div>
is a generic container with no semantic meaning.
<section>Content grouping</section> <div>Generic container</div>
<video>
tag with src
and controls attributes.
<video src="movie.mp4" controls width="320"></video>
<canvas>
element is a drawable region for graphics via JavaScript.
<canvas id="myCanvas" width="200" height="100"></canvas>
<select>
tag with <option>
tags.
<select name="fruits"> <option value="apple">Apple</option> <option value="banana">Banana</option> </select>
<iframe>
embeds another HTML page inside the current page.
<iframe src="https://example.com" width="300" height="200"></iframe>
<strong>
or <b>
tags to make text bold.
<strong>Important</strong> <b>Bold text</b>
<table>
tag along with <tr>
, <td>
, and <th>
tags.
<table> <tr> <th>Name</th> <th>Age</th> </tr> <tr> <td>Alice</td> <td>25</td> </tr> </table>
<input type="checkbox">
inside a form.
<input type="checkbox" id="subscribe" name="subscribe" value="yes"> <label for="subscribe">Subscribe to newsletter</label>
<meta>
tag defines metadata like charset, description, and viewport.
<meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link>
tag inside the <head>
.
<link rel="stylesheet" href="styles.css">
<header>
element represents introductory content or navigation.
<header> <h1>Site Title</h1> <nav>Navigation links</nav> </header>
<link>
tag with rel="icon" inside the <head>
.
<link rel="icon" href="favicon.ico" type="image/x-icon">
id
attribute specifies a unique identifier.
<div id="header">Content</div>
name
attribute to group them.
<input type="radio" name="gender" value="male"> Male <input type="radio" name="gender" value="female"> Female
<nav>
element defines navigation links.
<nav> <a href="#home">Home</a> <a href="#about">About</a> </nav>
<audio>
tag with src
and controls
.
<audio src="audio.mp3" controls></audio>
<b>
is stylistic bold; <strong>
indicates strong importance.
<b>Bold text</b> <strong>Important text</strong>
<ol>
tag with <li>
items.
<ol> <li>First</li> <li>Second</li> </ol>
class
attribute to specify CSS classes.
<div class="container">Content</div>
<main>
element defines the main content unique to the page.
<main> <h1>Welcome to the site</h1> </main>
placeholder
attribute inside the input tag.
<input type="text" placeholder="Enter your name">
<hr>
tag.
<hr>
maxlength
attribute.
<input type="text" maxlength="10">
<a href="https://example.com"> <img src="image.jpg" alt="Example Image"> </a>
<select name="fruits" id="fruits"> <option value="apple">Apple</option> <option value="banana">Banana</option> <option value="orange">Orange</option> </select>