This page is dedicated to providing you with a comprehensive guide on HTML, the standard markup language for creating web pages. Whether you're a beginner or looking to enhance your web development skills, this tutorial will cover the basics and advanced concepts of HTML.
Table of Contents
HTML Basics
HTML, which stands for HyperText Markup Language, is the backbone of web development. It is used to create the structure and content of web pages. HTML uses tags to define elements, such as headings, paragraphs, images, links, and more.
Basic HTML Structure
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
<img src="image.jpg" alt="Image description">
<a href="https://www.example.com">Link</a>
</body>
</html>
HTML Elements
HTML elements are the building blocks of HTML documents. They are defined by tags, which come in pairs: an opening tag and a closing tag. For example, the <h1>
tag is used to define a heading.
Common HTML Elements
<h1>
: Defines a large heading<h2>
: Defines a medium heading<h3>
: Defines a small heading<p>
: Defines a paragraph<img>
: Defines an image<a>
: Defines a hyperlink
HTML Attributes
HTML attributes provide additional information about HTML elements. Attributes are added to the opening tag of an element.
Common HTML Attributes
src
: Specifies the source of an imagealt
: Specifies alternative text for an imagehref
: Specifies the URL of a hyperlink
HTML Documents
An HTML document is a text document that contains HTML tags and content. It is saved with a .html
or .htm
file extension.
Example HTML Document
<!DOCTYPE html>
<html>
<head>
<title>My Web Page</title>
</head>
<body>
<h1>Welcome to My Web Page</h1>
<p>This is my first paragraph.</p>
<img src="image.jpg" alt="My image">
<a href="https://www.example.com">Visit Example.com</a>
</body>
</html>
Advanced HTML
Advanced HTML covers more complex topics, such as forms, tables, and multimedia.
Forms
HTML forms allow users to input data, which can be submitted to a server for processing.
<form action="submit.php" method="post">
<label for="name">Name:</label>
<input type="text" id="name" name="name">
<input type="submit" value="Submit">
</form>
Tables
HTML tables are used to display tabular data.
<table>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>Row 1, Cell 1</td>
<td>Row 1, Cell 2</td>
</tr>
<tr>
<td>Row 2, Cell 1</td>
<td>Row 2, Cell 2</td>
</tr>
</table>
Additional Resources
For further learning and reference, please visit the following resources: