What is HTML?
HTML (HyperText Markup Language) is the standard markup language for creating web pages. It describes the structure and content of a webpage using elements and tags.
💻 Your First HTML Page
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My First Web Page</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>This is my first webpage.</p>
</body>
</html>
🔧 HTML Structure Explained
<!-- Document Type Declaration -->
<!DOCTYPE html>
<!-- Root element -->
<html lang="en">
<!-- Metadata container -->
<head>
<meta charset="UTF-8">
<title>Page Title</title>
</head>
<!-- Visible content -->
<body>
<h1>Main Heading</h1>
<p>Paragraph text.</p>
</body>
</html>
Key Components:
- <!DOCTYPE html>: Declares HTML5 document
- <html>: Root element containing all content
- <head>: Contains metadata (not displayed)
- <body>: Contains visible page content
- <title>: Sets browser tab title
🎯 Key Takeaways
- HTML: Markup language for web structure
- Elements: Building blocks with opening/closing tags
- DOCTYPE: Declares HTML5 document type
- Head: Contains metadata and page info
- Body: Contains visible page content
- Tags: Written as <tagname>content</tagname>