What is HTML?
1. What is HTML?
HTML (HyperText Markup Language) is the standard language used to create web pages.
-
It defines the structure of a webpage
-
It tells the browser what content is (heading, paragraph, image, link, etc.)
-
HTML is not a programming language — it’s a markup language
👉 Think of HTML as the skeleton of a website.
2. Basic Structure of an HTML Document
Every HTML page follows a basic structure:
3. Explanation of Each Part
<!DOCTYPE html>
-
Tells the browser that this document is HTML5
-
Must be the first line of the document
<html> Tag
-
Root element of the HTML page
-
All HTML content is written inside this tag
<head> Tag
Contains meta-information about the page (not visible):
-
Page title
-
Character encoding
-
CSS links
-
SEO information
Example:
<title> Tag
-
Sets the title shown in the browser tab
-
Important for SEO
<body> Tag
-
Contains all visible content of the webpage:
-
Text
-
Images
-
Links
-
Forms
-
4. HTML Elements
An HTML element usually has:
Example:
-
<p>→ opening tag -
</p>→ closing tag -
Content → text between tags
5. HTML Tags
Tags tell the browser how to display content.
Common tags:
⚠️ Some tags don’t need closing tags:
6. HTML Comments
Comments are not displayed on the page.
Used for:
-
Explaining code
-
Debugging
-
Team collaboration
7. HTML Editors
You can write HTML using:
-
Notepad (basic)
-
VS Code (recommended)
-
Sublime Text
-
Atom
💡 Save HTML files with .html extension
8. HTML in Browser
-
Open
.htmlfile in any browser -
Browser reads HTML and displays the webpage
-
Browsers ignore extra spaces & line breaks
9. Simple Example (Complete)
Key Points to Remember
✔ HTML builds structure
✔ Tags define content
✔ Browser interprets HTML
✔ Always start with <!DOCTYPE html>
Comments
Post a Comment