HTML Tutorial
HTML (HyperText Markup Language) is the foundation for creating web pages. It consists of a series of elements, each with a specific purpose:
(<p>, <h1>, <h2>, etc.)
(<img>)
(<a>)
(<ol>, <ul>)
(<table>)
To create an HTML document, use a text editor (e.g., Notepad, Sublime Text) and follow these steps:
<!DOCTYPE html>
<html>
<head>
<title>My Web Page</title>
</head>
<body>
</body>
</html>
<body>
tags:<h1>My Web Page</h1>
<p>This is the main content of my page.</p>
<img src="image.jpg" alt="Image of a cat">
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
<table>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>John</td>
<td>30</td>
</tr>
</table>
Save the file with the extension .html
.
Open the file in a web browser to view the resulting web page.
<!DOCTYPE html>
<html>
<head>
<title>My First Web Page</title>
</head>
<body>
<h1>My First Web Page</h1>
<p>This is my first web page. I'm using HTML to create this page.</p>
<img src="cat.jpg" alt="A picture of a cat">
<ul>
<li>This is a list</li>
<li>Of items</li>
</ul>
<table>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>John</td>
<td>30</td>
</tr>
</table>
</body>
</html>
This example demonstrates various HTML elements in action:
<h1>
for the page title<p>
for the main content<img>
with an alternative text ("A picture of a cat")<ul>
<table>
with two columns ("Name" and "Age") and one row