ShapeYourPath
(current)
Run Code
Live Code Editor- Bootstrap 4 Horizontal Form
Source Code
<!DOCTYPE html> <html lang="en"> <head> <!-- Required meta tags --> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> <!-- Bootstrap CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" /> <title>Bootstrap 4 Horizontal Form</title> </head> <body> <div class="container mt-4"> <h1>Bootstrap 4 Horizontal Form</h1> <p class="text-justify">Bootstrap provides styling and alignment form controls elements.</p> <form action="" method="post"> <div class="form-group row"> <label for="inputUserName" class="col-sm-2 col-form-label">Name</label> <div class="col-sm-10"> <input type="text" class="form-control" id="inputUserName" placeholder="User Name" required /> </div> </div> <div class="form-group row"> <label for="inputUserName" class="col-sm-2 col-form-label">Gender</label> <div class="col-sm-10"> <label class="form-check-label"> <input type="radio" value="male" name="gender" /> male</label> <label class="form-check-label"><input type="radio" name="gender" value="Female" /> Female</label> </div> </div> <div class="form-group row"> <label for="inputEmail" class="col-sm-2 col-form-label">Email</label> <div class="col-sm-10"> <input type="email" class="form-control" id="inputEmail" placeholder="Email" required /> </div> </div> <div class="form-group row"> <label for="inputPassword" class="col-sm-2 col-form-label">Password</label> <div class="col-sm-10"> <input type="password" class="form-control" id="inputPassword" placeholder="Password" required /> </div> </div> <div class="form-group row"> <div class="col-sm-10 offset-sm-2"> <button type="button" class="btn btn-primary">Sign in</button> </div> </div> </form> </div> <!--/container--> <!-- jQuery first, then Popper.js, then Bootstrap JS --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> </body> </html>
Output :
Running