Here's an example of a payment form using Bootstrap:
html
<!DOCTYPE html>
<html>
<head>
<title>Payment 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">
<h2 class="mb-4">Payment Details</h2>
<form>
<div class="mb-3">
<label for="cardNumber" class="form-label">Card Number</label>
<input type="text" class="form-control" id="cardNumber" required>
</div>
<div class="mb-3">
<label for="cardName" class="form-label">Cardholder Name</label>
<input type="text" class="form-control" id="cardName" required>
</div>
<div class="row">
<div class="col-md-6 mb-3">
<label for="expiryDate" class="form-label">Expiry Date</label>
<input type="text" class="form-control" id="expiryDate" required>
</div>
<div class="col-md-6 mb-3">
<label for="cvv" class="form-label">CVV</label>
<input type="text" class="form-control" id="cvv" required>
</div>
</div>
<div class="text-center">
<button type="submit" class="btn btn-primary">Pay Now</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 payment form is structured using the Bootstrap grid system and form components.
The form includes input fields for card number, cardholder name, expiry date, and CVV. The fields are created using the `<input>` element with the `form-control` class to apply Bootstrap styling.
The `mb-3` class is added to the form components to provide vertical margin between the fields.
The expiry date and CVV fields are placed in a row with two columns using the `row` and `col-md-6` classes. This ensures that they are displayed side by side on medium and larger screens.
The `required` attribute is added to the input fields to make them mandatory.
The `btn-primary` class is applied to the "Pay Now" button for styling.
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