HTML (HyperText Markup Language) is the standard language used to create web pages. It provides the structure and elements needed to display content on a webpage.
An HTML document is made up of essential components:
<!DOCTYPE html>
<html>
<head>
<title>My First Webpage</title>
</head>
<body>
<h1>Welcome to My Website</h1>
<p>This is a paragraph of text in HTML.</p>
</body>
</html>
DOCTYPE html declares the document type and version.
html is the root element that wraps all content.
head contains metadata such as title, links to CSS, and scripts.
title defines the title shown in the browser tab.
body holds visible webpage content.
HTML has six heading levels:
<h1>Main Heading</h1>
<h2>Subheading</h2>
<h3>Smaller Subheading</h3>
h1 is the largest, while h6 is the smallest.
Text is placed inside p tags.
<p>This is a paragraph of text.</p>
Hyperlinks are created using a tags:
<a href="https://example.com">Click Here</a>
Images are embedded using img tags:
<img src="image.jpg" alt="Description">
Unordered List (Bullets):
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
Ordered List (Numbers):
<ol>
<li>First item</li>
<li>Second item</li>
</ol>
Tables organize data into rows and columns:
<table>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>Alice</td>
<td>25</td>
</tr>
</table>
Forms allow users to enter data:
<form action="submit.php" method="post">
<label for="name">Name:</label>
<input type="text" id="name" name="name">
<input type="submit" value="Submit">
</form>
You can style your webpage using CSS (Cascading Style Sheets).
<style>
body {
background-color: lightblue;
font-family: Arial, sans-serif;
}
</style>
HTML is the foundation of web development, allowing you to create structured, accessible, and interactive web pages. Once you master HTML basics, you can combine it with CSS and JavaScript to build modern websites.