Learn HTML: A Beginner's Guide
1. What is HTML?
HTML stands for HyperText Markup Language. It is used to create the structure of a webpage.
2. Basic Structure of an HTML Document
Every HTML document starts with a basic structure. Below is an example:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Your Title</title> </head> <body> <h1>This is a heading</h1> <p>This is a paragraph.</p> </body> </html>
3. Headings and Paragraphs
HTML provides various heading tags (from <h1>
to <h6>
) and paragraph tags using <p>
.
<h1>This is a Heading 1</h1> <h2>This is a Heading 2</h2> <p>This is a paragraph.</p>
4. Links and Images
HTML allows you to add links using the <a>
tag and images using the <img>
tag.
Example for a link:
<a href="https://www.example.com">Visit Example</a>
Example for an image:
<img src="image.jpg" alt="Image Description">
5. Creating Tables
You can create tables using the <table>
, <tr>
(for rows), and <td>
(for cells) tags.
<table> <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>