Courses / Application of ICT (GEN-103) – BS 1st Semester
Week 14 Lab 14 – HTML: Creating Your First Web Page
Week 14 – The Internet and Web Browsers · 90 min read · 8 MCQs to check yourself
Lab objectives
Write, save and open your first HTML document using a text editor; practise HTML tags, head and body; edit and refresh.
Tools needed
- A text editor: Notepad (built into Windows), Notepad++, or Visual Studio Code (recommended – free, with colour highlighting and auto-complete).
- A web browser: Chrome, Edge or Firefox.
- (Do not use MS Word – it adds its own formatting.)
Task 1 – Create a folder
Create a folder D:\ICT-Web (or in Documents) to keep all your web pages and images together.
Task 2 – Type your first HTML document
Open Notepad and type exactly:
<!DOCTYPE html>
<html>
<head>
<title>My First Web Page</title>
</head>
<body>
<h1>Welcome to My Web Page</h1>
<p>My name is Ayesha Khan. I am a student of BS IT, Semester 1.</p>
<p>This page was created in the ICT lab using HTML.</p>
<!-- This is a comment and will not be displayed -->
</body>
</html>
Task 3 – Save the file correctly
- File → Save As.
- Browse to
ICT-Web. - Save as type: choose All Files (*.*) (otherwise Notepad adds
.txt). - File name:
index.html(orfirst.html). - Encoding: UTF-8 → Save.
The file icon now shows the browser logo.
Task 4 – Open in a browser
- Double-click the file, or right-click → Open with → Chrome, or drag it into the browser window.
- The title "My First Web Page" appears on the browser tab; the heading and paragraphs appear in the page.
- The address bar shows a file path such as
file:///D:/ICT-Web/index.html(local file, not on the Internet).
Task 5 – Edit and refresh
- Keep both Notepad and the browser open.
- Change the text in Notepad (e.g. add another paragraph) → Ctrl + S.
- Switch to the browser → press F5 (Refresh) to see changes.
- View page source in the browser: right-click → View page source (Ctrl + U). Inspect (F12) shows the elements.
Task 6 – Practise head and body tags
Add to the <head>:
<head>
<meta charset="UTF-8">
<meta name="description" content="Personal page of a BS IT student">
<meta name="author" content="Ayesha Khan">
<title>Ayesha – BS IT Student</title>
</head>
Add body attributes (older HTML style practised in the syllabus):
<body bgcolor="lightyellow" text="darkblue">
Observe: the background colour and text colour of the whole page change. Information in <head> is not displayed on the page (except the title on the tab).
Common mistakes and fixes
| Problem | Cause / fix |
|---|---|
| File opens in Notepad instead of browser | Saved as index.html.txt – choose All Files when saving |
| Tags appear on the page as text | Missing < or >, or file saved as .txt |
| Changes not visible | Forgot to save (Ctrl + S) or refresh (F5) |
| Whole page becomes bold/big | A tag was not closed (e.g. missing </h1>) |
| Strange characters | Save with UTF-8 encoding |
Lab exercise (submit)
Create aboutme.html with title "About [Your Name]", a main heading with your name, three paragraphs (introduction, hobbies, future goals), a comment line, meta author tag, and body background colour of your choice. Save, open in the browser, change one paragraph, refresh and show the page source.
HTML Tutorial for Beginners: HTML Crash Course (Programming with Mosh)
Short and long questions
1. Write a complete HTML document for a personal web page and explain each tag used.
Model answer
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Ali Raza – Personal Page</title>
</head>
<body bgcolor="lightcyan" text="navy">
<h1>Ali Raza</h1>
<p>I am a student of BS Information Technology.</p>
<p>My hobbies are reading, cricket and coding.</p>
<!-- end of page -->
</body>
</html>
<!DOCTYPE html> declares HTML5; <html> is the root element; <head> holds page information; <meta charset> sets character encoding; <title> shows text on the browser tab; <body> holds visible content with bgcolor (background) and text (text colour); <h1> is the main heading; <p> creates paragraphs; <!-- --> is a comment not displayed.
2. Write the steps to create, save and view an HTML page using Notepad.
Model answer
Open Notepad → type the HTML code → File → Save As → choose the folder → Save as type: All Files → name the file with .html extension (e.g. index.html) → Encoding UTF-8 → Save → double-click the file (or Open with → browser) to view; after editing press Ctrl+S and refresh the browser with F5.
3. What information is placed in the head section of an HTML page?
Model answer
The head contains information about the page that is not displayed in the page area: the title (shown on the browser tab), meta tags (charset, description, author, keywords), links to CSS files, scripts and styles.
This lesson ends with a quiz of 8 MCQs. Open the lesson on PrepOasis to take it and save your progress.
Previous: Week 14 Theory – The Internet, Browsers and Search Engines · Next: Week 15 Theory – The World Wide Web
All lessons in Application of ICT (GEN-103) – BS 1st Semester