HTML BASIC PROGRAMME
1.
<!DOCTYPE html>
<html>
<head>
<title>My First Webpage</title>
</head>
<body>
<h1>Welcome to My Webpage</h1>
<p>This is a basic HTML program.</p>
<a href="https://www.google.com" target="_blank">Visit Google</a>
<br><br>
<img src="https://via.placeholder.com/200" alt="Sample Image">
</body>
</html>
Explanation:
• <!DOCTYPE html> → Defines the document type as HTML5.
• <html>...</html> → Root of the page.
• <head> → Contains metadata (title, links, etc.).
• <title> → Title shown in the browser tab.
• <body> → Content visible on the page.
• <h1> → Main heading.
• <p> → Paragraph text.
• <a> → Hyperlink.
• <img> → Image tag with a placeholder image.
2.
<!DOCTYPE html>
<html>
<head>
<title>Student Registration Form</title>
</head>
<body>
<h2>Student Registration</h2>
<form>
<label for="name">Full Name:</label><br>
<input type="text" id="name" name="name" required><br><br>
<label for="email">Email:</label><br>
<input type="email" id="email" name="email" required><br><br>
<label for="age">Age:</label><br>
<input type="number" id="age" name="age"><br><br>
<label for="gender">Gender:</label><br>
<input type="radio" id="male" name="gender" value="male"> Male
<input type="radio" id="female" name="gender" value="female">
Female<br><br>
<label for="course">Select Course:</label><br>
<select id="course" name="course">
<option value="html">HTML</option>
<option value="css">CSS</option>
<option value="javascript">JavaScript</option>
</select><br><br>
<input type="submit" value="Register">
</form>
</body>
</html>
this program creates a basic registration form where the user can enter details
and click Register.
Let me break it down for you:
🔎 Explanation of Your Code
• <!DOCTYPE html> → Tells browser you’re using HTML5.
• <head><title>...</title></head> → Page title (shown in the
browser tab).
• <body> → Everything visible on the page.
• <form> → Wraps all input fields together.
• <label> → Text description for each input (improves accessibility).
• <input> → Different fields for text, email, number, and radio buttons.
• <select> → Dropdown menu to pick a course.
• <input type="submit"> → A button that submits the form.
How It Works:
• User types name, email, age, chooses gender, selects a course, and then
clicks Register.
• By default, the form will reload the page when submitted (because
there’s no backend yet).