Unit 1: Creating Of Index.Html
What is index.html?
index.html is the main file of any website.
Whenever you open a website, the browser first looks for:
index.html
-> It is the homepage (default page)
-> Every website must have this file.
How to Create index.html
Step-by-Step:
Step 1:
Right-click in a folder → Click New File
Step 2:
Name the file:
index.html
Important Tip:
->Must end with .html
->Not .txt
Step 3:
Open it in a code editor (like VS Code , notepad , codeblock)
Unit 2: Basic Structure of HTML
Basic Structure of HTML
Every HTML page follows a fixed structure.
->Standard Template:
<!DOCTYPE html><html><head>
<title>My First Website</title>
</head>
<body>
<h1>Hello World</h1>
<p>This is my first webpage.</p>
</body>
</html>
Understanding Each Part
<!DOCTYPE html>
- Tells browser → This is an HTML5 document
<html>
- Root of the webpage
- Everything comes inside this
<head>
- Contains information
- Not visible on page
-> Example:
- Title
- Meta data
<title>
- Shows in browser tab
<body>
- Main content of website
- Everything user sees
-> Example:
- Text
- Images
- Buttons
Real Example Explained
<h1>Welcome</h1>
<p>This is my website</p>
- Big heading → Welcome
- Small text → This is my website
Important Rules
->Always close tags:
<p></p>
->Use proper nesting:
<body>
<h1></h1>
</body>
->File name must be:
index.html
Unit 3: Running HTML in Browser
1. Introduction
After writing HTML code, the next step is to run and view your webpage. Unlike programming languages, HTML does not need a compiler — it runs directly in a web browser like Chrome, Edge, or Firefox.
2. What is a Browser?
A browser is software used to open and view websites.
Examples:
- Google Chrome
- Microsoft Edge
- Mozilla Firefox(Not Used Much Now)
- Opera Gx
The browser reads your HTML file and shows it as a webpage.
3. Steps to Run HTML File
Step 1: Create HTML File
- Open Notepad or VS Code
- Save file as:
index.html - Open An Browser (Google , Opera etc) and Press [ctrl + O] select Your File And Click On It.