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

Solutions of HTML Practice Question

The document provides solutions to HTML practice questions involving creating forms, tables, headings, and recreating forms using appropriate HTML elements and input types. The questions cover a range of common HTML elements and attributes.

Uploaded by

chetandhapola44
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Solutions of HTML Practice Question

The document provides solutions to HTML practice questions involving creating forms, tables, headings, and recreating forms using appropriate HTML elements and input types. The questions cover a range of common HTML elements and attributes.

Uploaded by

chetandhapola44
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Solutions of HTML practice questions

Q.1 make a form.


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Registration Form</title>
</head>
<body>
<h2>Registration Form</h2>
<form action="#" method="post">
<label for="username">Username:</label>
<input type="text" id="username" name="username" 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="confirm_password">Confirm Password:</label>


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

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


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

<label for="gender">Gender:</label>
<select id="gender" name="gender" required>
<option value="">Select</option>
<option value="male">Male</option>
<option value="female">Female</option>
<option value="other">Other</option>
</select><br><br>

<label>Tick Marks:</label><br>
<input type="checkbox" id="tick1" name="tick1">
<label for="tick1">Option 1</label><br>
<input type="checkbox" id="tick2" name="tick2">
<label for="tick2">Option 2</label><br><br>

<label for="feedback">Feedback:</label><br>
<select id="feedback" name="feedback" required>
<option value="">Select</option>
<option value="excellent">Excellent</option>
<option value="good">Good</option>
<option value="average">Average</option>
<option value="poor">Poor</option>
</select><br><br>
<label for="additional_comments">Additional Comments:</label><br>
<textarea id="additional_comments" name="additional_comments" rows="4" cols="50">
</textarea><br><br>

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


</form>
</body>
</html>

Q.2 Re-create following table.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Merged Cell Table</title>
</head>
<body>
<h2>Merged Cell Table</h2>
<table border="1">
<tr>
<th colspan="2">Personal Information</th>
<th rowspan="2">Contact</th>
</tr>
<tr>
<td>Name:</td>
<td>John Doe</td>
</tr>
<tr>
<td rowspan="2">Address:</td>
<td>123 Main Street</td>
<td>Email: [email protected]</td>
</tr>
<tr>
<td>City: Anytown</td>
<td>Phone: 123-456-7890</td>
</tr>
</table>
</body>
</html>

Q.3 Print the following using h1 heading element.


To print Pythagorean theorem

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pythagorean Theorem</title>
</head>
<body>
<h2>Pythagorean Theorem</h2>
<p>a<sup>2</sup> + b<sup>2</sup> = c<sup>2</sup></p>
</body>
</html>

To print formula of glucose

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Glucose Formula</title>
</head>
<body>
<h2>Glucose Formula</h2>
<p>C<sub>6</sub>H<sub>12</sub>O<sub>6</sub></p>
</body>
</html>

Q.4 Print the following using h1 heading element and entities.


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Weather Report</title>
</head>
<body>
<h1>Today &nbsp;&nbsp;&#9728; is bright and &nbsp;&#9729;&#65039; are black</h1>
</body>
</html>
Q.5 Re-create the following form with suitable elements and
input type.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Registration Form</title>
</head>
<body>
<h2>Registration Form</h2>
<form action="#" method="post">
<label for="first_name">First Name:</label>
<input type="text" id="first_name" name="first_name" required><br><br>

<label for="last_name">Last Name:</label>


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

<label for="gender">Gender:</label>
<select id="gender" name="gender" required>
<option value="">Select</option>
<option value="male">Male</option>
<option value="female">Female</option>
<option value="other">Other</option>
</select><br><br>

<label for="agree_terms">Agree to Terms:</label>


<input type="radio" id="agree_yes" name="agree_terms" value="yes" required>
<label for="agree_yes">Yes</label>
<input type="radio" id="agree_no" name="agree_terms" value="no" required>
<label for="agree_no">No</label><br><br>

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


</form>
</body>
</html>

You might also like