0% found this document useful (0 votes)
2 views

HTml short programs

The document contains multiple HTML examples including a 'Hello World' page that displays the current date, a user registration form with fields for name, email, password, and date of birth, a table displaying student records, a styled heading with CSS, and a list of favorite foods. Each section demonstrates different HTML functionalities and structures. Overall, it serves as a basic introduction to HTML elements and their usage.

Uploaded by

angelin272004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

HTml short programs

The document contains multiple HTML examples including a 'Hello World' page that displays the current date, a user registration form with fields for name, email, password, and date of birth, a table displaying student records, a styled heading with CSS, and a list of favorite foods. Each section demonstrates different HTML functionalities and structures. Overall, it serves as a basic introduction to HTML elements and their usage.

Uploaded by

angelin272004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

HELLO WORLD AND TODAY’S DATE:

<!DOCTYPE html>

<head>

<title>Hello World</title>

</head>

<body>

<h1>Hello, World!</h1>

<p>Today's date is: <span id="date"></span></p>

<script>

document.getElementById("date").textContent = new Date().toDateString();

</script>

</body>

</html>

HTML FORM ( User registration):

<!DOCTYPE html>

<head>

<title>User Registration</title>

</head>

<body>

<h1>User Registration</h1>

<form action="#" method="post">

<label for="name">Name:</label>

<input type="text" id="name" name="name" required><br><br>

<label for="email">Email:</label>

<input type="email" id="email" name="email" required><br><br>

<label for="password">Password:</label>

<input type="password" id="password" name="password" required><br><br>


<label for="dob">Date of Birth:</label>

<input type="date" id="dob" name="dob" required><br><br>

<input type="submit" value="Register">

</form>

</body>

</html>

HTML Table ( student records)

<!DOCTYPE html>

<head>

<title>Student Records</title>

</head>

<body>

<h1>Student Records</h1>

<table border="1">

<tr>

<th>Name</th>

<th>Age</th>

<th>Grade</th>

</tr>

<tr>

<td>John Doe</td>

<td>18</td>

<td>A</td>

</tr>

<tr>

<td>Jane Smith</td>

<td>17</td>

<td>B</td>

</tr>
</table>

</body>

</html>

HTML with CSS(Styled heading)

<!DOCTYPE html>

<head>

<title>Styled Heading</title>

<style>

h1 {

color: white;

background-color: blue;

text-align: center;

padding: 10px;

</style>

</head>

<body>

<h1>Welcome to My Page</h1>

</body>

</html>

HTML List(Favourite Food):

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Favorite Foods</title>

</head>

<body>
<h1>My Favorite Foods</h1>

<ul>

<li>Pizza</li>

<li>Biryani</li>

<li>Sushi</li>

<li>Burger</li>

<li>Pasta</li>

</ul>

</body>

</html>

You might also like