Welcome to the world of HTML! This guide will help you understand the basics of HTML structure, tags, and elements.
Basic Structure of an HTML Document 📁
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>Heading</h1>
<p>Paragraph text.</p>
</body>
</html>
<!DOCTYPE html>
declares the document type<html>
is the root element<head>
contains metadata<body>
holds the content visible to users
Common HTML Tags 📝
Tag | Purpose |
---|---|
<h1> -<h6> |
Headings (h1 is largest) |
<p> |
Paragraphs |
<a> |
Hyperlinks |
<img> |
Images |
<ul> -<ol> |
Unordered/Ordered lists |
Elements & Attributes 🎯
- Elements are defined by tags (e.g.,
<p>
) - Attributes add properties (e.g.,
href="https://example.com"
in<a href="...">
) - Use
alt
attribute for images:<img src="image.jpg" alt="Descriptive text">
Expand Your Knowledge 📚
For more details on HTML syntax and structure, visit our HTML Syntax Tutorial.