HTML

HTML Tags:

Basic Structure:

<html>:  The root element that wraps the entire HTML document.

<head>:  Contains meta-information about the document, such as the title and character set.

<title>:  Sets the title of the web page, displayed in the browser tab.

<body>:  Contains the content of the HTML document, like text, images, links, etc.

Text and Formatting:

<p>:  Defines a paragraph.

<h1> to <h6>:  Defines HTML headings, with <h1> being the highest level and <h6> being the lowest.

<a>:  Defines a hyperlink.

<img>:  Embeds an image in the HTML document.

<b>:  Makes text bold.

<i>:  Makes text italic.

<u>:  Underlines text.

<br>:  Inserts a single line break.

<div>:  Defines a division or section in an HTML document.

<hr>:  Inserts a horizontal rule (line) to separate content.

Lists:

<ul>:  Defines an unordered (bulleted) list.

<ol>:  Defines an ordered (numbered) list.

<li>:  Defines a list item.

<dl>:  Defines a description list.

<dt>:  Defines a term in a description list.

<dd>:  Describes the term in a description list.

Forms:

<form>:  Defines an HTML form for collecting user input.

<input>:  Defines an input control.

<label>:  Defines a label for an <input> element.

Other Important Tags:

<meta>:  Provides metadata about the HTML document, such as character set or description.

<style>:  Contains CSS code for styling the HTML document.

<script>:  Contains JavaScript code for adding interactivity to the HTML document.

<nav>:  Represents a section of a page that provides navigation links.

<section>:  Defines a section in a document.

<article>:  Represents a self-contained composition in a document.

<footer>:  Defines a footer for a document or section.

<header>:  Defines a header for a document or section.

HTML Code example:

<html lang=“en”><head> <meta charset=“UTF-8”> <meta name=“viewport” content=“width=device-width, initial-scale=1.0”> <title>Long HTML Example</title> <link rel=“stylesheet” href=“style.css”></head><body> <header> <h1>Welcome to My Website</h1> <nav> <ul> <li><a href=“#”>Home</a></li> <li><a href=“#”>About</a></li> <li><a href=“#”>Services</a></li> <li><a href=“#”>Contact</a></li> </ul> </nav> </header> <main> <section id=“introduction”> <h2>About Us</h2> <p>This is a longer paragraph explaining the purpose of the website. We are a company dedicated to…</p> <img src=“image.jpg” alt=“Company Image” width=“300” height=“200”> </section> <section id=“services”> <h2>Our Services</h2> <article> <h3>Service 1</h3> <p>Details about service 1…</p> </article> <article> <h3>Service 2</h3> <p>Details about service 2…</p> </article> <article> <h3>Service 3</h3> <p>Details about service 3…</p> </article> </section> <section id=“contact”> <h2>Contact Us</h2> <form action=“#” method=“post”> <label for=“name”>Name:</label> <input type=“text” id=“name” name=“name” required> <label for=“email”>Email:</label> <input type=“email” id=“email” name=“email” required> <label for=“message”>Message:</label> <textarea id=“message” name=“message” rows=“4” required></textarea> <input type=“submit” value=“Submit”> </form> </section> </main> <footer> <p>&copy; 2025 My Company. All rights reserved.</p> </footer></body></html>
Capture of html example