Task 1 — Create your first HTML page
- Create a folder for this lab and name it after yourself. Do not use spaces in folder or file names.
- Open a text editor such as Notepad, Notepad++ or Sublime Text.
- Key in the code below and save the file as
mysite.html. In Notepad, choose All Files in the "Save as type" dropdown so it does not becomemysite.html.txt. - Open
mysite.htmlin a web browser (right-click → Open with → Firefox or Chrome) to see the result.
Every HTML5 document starts with <!DOCTYPE html>. The visible content lives between <body> and </body>, and the text between the <title> tags appears in the browser tab — not in the page itself.
Code
<!DOCTYPE html>
<html>
<head>
<title>My first website</title>
</head>
<body>
<h1>This is the main title</h1>
<h2>This is the subtitle</h2>
<p>Assalamu'alaikum. Hello World. This is my first page.</p>
<hr>
<p>This is my first paragraph.</p>
<p>This is my second paragraph.</p>
</body>
</html>