WebTech (P1)
WebTech (P1)
Objective: Write a simple html registration form which stores students details required for
admission process in a university such as First name, Last name, roll no, course, branch, gender,
phone number, subject choice, hobbies and testimonial.
Introduction:
Different types of input tags and buttons used here are:
<input>: tag is a fundamental element in HTML, used to create interactive controls for web-
based forms to accept data from users.
<button>: Creates a clickable button.
<form>: Contains interactive controls that users can use to submit data.
action: Specifies the URL to send the form data to when the form is submitted.
class: Specifies one or more class names for an element, which can be used to apply CSS
styles or target elements with JavaScript.
id: Defines a unique identifier for an HTML element, which can be used for styling or
scripting.
name: Specifies a name for <input>, <select>, or <textarea>, which is used to reference form
data.
Important HTML Buttons: -
Program:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
/* General Styling */
body {
background-color: #f0f5f9;
margin: 0;
padding: 30px;
.form-container {
max-width: 650px;
margin: 0 auto;
background-color: #ffffff;
padding: 40px;
border-radius: 15px;
border: none;
h1 {
text-align: center;
color: #333;
font-size: 26px;
margin-bottom: 25px;
.form-group {
margin-bottom: 20px;
.form-group label {
font-weight: bold;
display: block;
margin-bottom: 8px;
color: #555;
.form-group input,
.form-group select,
.form-group textarea {
width: 100%;
padding: 12px;
border-radius: 10px;
background-color: #f9fafb;
font-size: 15px;
.form-group input[type="radio"],
.form-group input[type="checkbox"] {
width: auto;
margin-right: 10px;
}
.form-group input[type="file"] {
padding: 5px 0;
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
border-color: #a8d5ba;
.form-group textarea {
resize: vertical;
.submit-btn {
width: 100%;
background-color: #a8d5ba;
color: #fff;
padding: 12px;
border: none;
cursor: pointer;
font-size: 16px;
border-radius: 10px;
.submit-btn:hover {
background-color: #8ec1a1;
}
.form-group input[type="radio"] + label,
display: inline;
margin-left: 5px;
.checkbox-group,
.radio-group {
display: flex;
flex-wrap: wrap;
gap: 10px;
.checkbox-group input[type="checkbox"],
.radio-group input[type="radio"] {
margin-right: 8px;
body {
.form-container {
background-color: #fff;
padding: 30px;
border-radius: 15px;
border: none;
h1 {
.form-group input,
.form-group select,
.form-group textarea {
padding: 10px;
font-size: 15px;
.form-group label {
.submit-btn {
color: #333;
.submit-btn:hover {
</style>
</head>
<body>
<div class="form-container">
<div class="form-group">
<div class="form-group">
</div>
<div class="form-group">
</div>
<div class="form-group">
<label for="course">Course:</label>
<option value="B.Tech">B.Tech</option>
<option value="M.Tech">M.Tech</option>
<option value="MBA">MBA</option>
<option value="PhD">PhD</option>
</select>
</div>
<div class="form-group">
<label for="branch">Branch:</label>
</div>
<label>Gender:</label>
<div class="radio-group">
<label for="male">Male</label>
<label for="female">Female</label>
<label for="other">Other</label>
</div>
</div>
<div class="form-group">
</div>
<div class="form-group">
<div class="checkbox-group">
<label for="subject1">Mathematics</label>
<label for="subject2">Physics</label>
<label for="subject3">Chemistry</label>
<input type="checkbox" id="subject4" name="subjects[]" value="Computer Science">
</div>
</div>
<div class="form-group">
<label for="hobbies">Hobbies:</label>
<div class="checkbox-group">
<label for="hobby1">Reading</label>
<label for="hobby2">Sports</label>
<label for="hobby3">Music</label>
<label for="hobby4">Traveling</label>
</div>
</div>
<div class="form-group">
<label for="testimonial">Testimonial:</label>
</div>
<div class="form-group">
<label for="photo">Upload Your Photo:</label>
</div>
</form>
</div>
</body>
</html>
Output: