Learn HTML
This is the main article.
Description: Create a web page in HTML using Notepad, save it, and open it in a browser.
Hint:
index.html with the type “All Files”.<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My First Web Page</title>
</head>
<body>
<h1>Welcome to My Page</h1>
<p>This page was created using Notepad.</p>
</body>
</html>
Output in the browser:
This page was created using Notepad.
index.html, set “Save as type” to All Files and the encoding to UTF-8.A detailed guide with pictures is in HTML First Program using Notepad.
Description: Write a program that shows the difference between two paragraphs and a single text with line breaks.
Hint:
<p> tags for the paragraphs.<br> tag inside one paragraph for the line break.<!DOCTYPE html>
<html lang="en">
<head>
<title>Paragraph vs line break</title>
</head>
<body>
<h3>Two paragraphs</h3>
<p>This is the first paragraph.</p>
<p>This is the second paragraph.</p>
<h3>One paragraph with a line break</h3>
<p>This is the first line.<br>This is the second line.</p>
</body>
</html>
Output in the browser:
This is the first paragraph.
This is the second paragraph.
This is the first line.
This is the second line.
<p> adds a space above and below, so the paragraphs look separate.<br> only moves the text to the next line. The lines stay close, as they are still one paragraph.<br> for things like an address or a poem.Read HTML Paragraphs.
Description: Create a registration form that takes name, email, password, gender, hobbies and country, and has a Register button.
Hint:
form tag with method="post".label to its field with for and id.name.<form action="register.php" method="post">
<p><label for="name">Name:</label>
<input type="text" id="name" name="name" required></p>
<p><label for="email">Email:</label>
<input type="email" id="email" name="email" required></p>
<p><label for="pass">Password:</label>
<input type="password" id="pass" name="password" required></p>
<p>Gender:
<input type="radio" id="m" name="gender" value="male"><label for="m">Male</label>
<input type="radio" id="f" name="gender" value="female"><label for="f">Female</label></p>
<p>Hobbies:
<input type="checkbox" id="h1" name="hobby" value="reading"><label for="h1">Reading</label>
<input type="checkbox" id="h2" name="hobby" value="music"><label for="h2">Music</label></p>
<p><label for="country">Country:</label>
<select id="country" name="country">
<option value="india">India</option>
<option value="usa">USA</option>
</select></p>
<button type="submit">Register</button>
</form>
Output in the browser:
required attribute stops the form from being sent when the field is empty.type="email" checks the email format, and type="password" hides the typed text.register.php with the POST method. That file must be made with a server language like PHP.Read HTML Forms and HTML Input Types.
Description: Create a web page layout with a header, a navigation bar, a main area with an article and a sidebar, and a footer.
Hint:
header, nav, main, article, aside and footer.<!DOCTYPE html>
<html lang="en">
<head>
<title>My Blog</title>
</head>
<body>
<header>
<h1>My Blog</h1>
</header>
<nav>
<a href="/">Home</a> | <a href="/about">About</a>
</nav>
<main>
<article>
<h2>Learn HTML</h2>
<p>This is the main article.</p>
</article>
<aside>
<h3>Related links</h3>
<p>Links go here.</p>
</aside>
</main>
<footer>
<p>© 2025 My Blog</p>
</footer>
</body>
</html>
Output in the browser:
This is the main article.
aside next to the article.Read HTML Semantic Elements. A div based version is in Basic HTML page layout using div tags.