Introduction to HTML
What is HTML?
HTML (HyperText Markup Language) is the standard language used to create webpages. It
structures content on the web using elements enclosed in tags.
Basic Structure of an HTML Document
An HTML document follows a specific structure:
<!DOCTYPE html> <!-- Declares HTML5 -->
<html>
<head>
<title>My First Webpage</title> <!-- Page title shown on browser tab -->
</head>
<body>
<h1>Welcome to My Website</h1>
<p>This is a simple webpage.</p>
</body>
</html>
Important HTML Tags
Below are essential HTML tags and their purposes:
Headers
- <h1>...</h1> to <h6>...</h6> define headings, where <h1> is the largest.
<h1>Main Title</h1>
<h2>Subheading</h2>
Text Formatting
<p> - Defines a paragraph.
<strong> - Makes text bold and indicates importance.
<em> - Italicizes text for emphasis.
<mark> - Highlights text.
<abbr> - Defines abbreviations.
Links & Images
<a> - Creates a hyperlink.
<img> - Displays an image.
Lists
<ol> - Ordered list (numbered).
<ul> - Unordered list (bulleted).
<li> - List item.
Interactive Elements
<details> - Expandable section.
<summary> - Summary of details.
Time & Special Characters
<time> - Represents time/date.
© - Displays copyright symbol.
Structure and Separation
<div> - Groups content.
<hr> - Creates a horizontal line.
<footer> - Defines a footer.
Example: A Simple HTML Page
<!DOCTYPE html>
<html>
<head>
<title>About Space Exploration</title>
</head>
<body>
<h1>Exploring the Universe</h1>
<h2>The Beauty of Space</h2>
<p>Space exploration helps us understand our universe better.</p>
<h3>Key Missions</h3>
<ul>
<li>Apollo 11 - First Moon Landing</li>
<li>Voyager 1 - Deep Space Exploration</li>
</ul>
<img src="[Link]" alt="View of space" title="The Universe" width="300">
<details>
<summary>Learn More</summary>
<p>NASA continues to explore beyond our solar system.</p>
</details>
<footer>
<p>© 2025 Space Enthusiasts</p>
</footer>
</body>
</html>