Saved Bookmarks
| 1. |
How to change the size of the input groups in Bootstrap? |
|
Answer» The input group size can be easily changed in Bootstrap, using the .input-group-lg and input-group-sm, classes. Here, the .input-group-lg is used for large input groups. The .input-group-sm is used for small input groups. The following is an example that displays how to change the size of the input groups in Bootstrap: <!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap Input Group Size</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script> </head> <body> <div CLASS="CONTAINER mt-3"> <h2>Input Group Size</h2> <form> <div class="input-group mb-3 input-group-sm"> <div class="input-group-prepend"> <span class="input-group-text">Small</span> </div> <input TYPE="NUMBER" class="form-control"> </div> </form> <form> <div class="input-group mb-3 input-group-lg"> <div class="input-group-prepend"> <span class="input-group-text">Large</span> </div> <input type="number" class="form-control"> </div> </form> </div> </body> </html>The output display different sizes of inputs: |
|