Registration form with bootstrap

Here's an example of a registration form using Bootstrap:


html
<!DOCTYPE html>
<html>
<head>
<title>Registration Form</title>
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/css/bootstrap.min.css">
</head>
<body>
<div class="container mt-5">
    <div class="row justify-content-center">
        <div class="col-lg-6 col-md-8">
            <h2 class="mb-4">Registration</h2>
            <form>
                <div class="mb-3">
                    <label for="name" class="form-label">Name</label>
                    <input type="text" class="form-control" id="name" required>
                </div>
                <div class="mb-3">
                    <label for="email" class="form-label">Email</label>
                    <input type="email" class="form-control" id="email" required>
                </div>
                <div class="mb-3">
                    <label for="password" class="form-label">Password</label>
                    <input type="password" class="form-control" id="password" required>
                </div>
                <div class="mb-3">
                    <label for="confirm-password" class="form-label">Confirm Password</label>
                    <input type="password" class="form-control" id="confirm-password" required>
                </div>
                <div class="text-center">
                    <button type="submit" class="btn btn-primary">Register</button>
                </div>
            </form>
        </div>
    </div>
</div>

<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/js/bootstrap.bundle.min.js"></script>
</body>
</html>

In this example, the registration form follows a similar structure to the login form. It consists of input fields for name, email, password, and confirm password, along with a register button.

Bootstrap classes such as `container`, `row`, `col-*`, `mb-*`, `form-label`, `form-control`, and `btn` are utilized for styling and responsiveness.

The `justify-content-center` class is added to the row to horizontally center the registration form. The `col-lg-6 col-md-8` classes define the column size for medium and large screen sizes.

The `mt-5` class is used to add margin-top to the container for spacing, and the `mb-4` class adds margin-bottom to the heading.

The `required` attribute is added to the input fields to make them mandatory.

The `btn-primary` class is applied to the register button for styling.

Remember to include the Bootstrap CSS and JavaScript files using a CDN or by hosting them locally.

Feel free to modify the code as needed, such as adding form validation or handling the form submission according to your specific requirements.


Output:



About the Author



Silan Software is one of the India's leading provider of offline & online training for Java, Python, AI (Machine Learning, Deep Learning), Data Science, Software Development & many more emerging Technologies.

We provide Academic Training || Industrial Training || Corporate Training || Internship || Java || Python || AI using Python || Data Science etc





 PreviousNext