InterviewSolution
Saved Bookmarks
| 1. |
How to change the size of Form controls in Bootstrap |
|
Answer» Use the CLASSES .input-lg and .input-sm to change the size of form controls in Bootstrap: The following is an example: <!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap Form Input Sizing</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <SCRIPT src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <h2>Sizing Form Input Controls</h2> <form> <div class="form-group"> <label for="inputdefault">Regular input size</label> <input class="form-control" id="inputdefault" type="text"> </div> <div class="form-group"> <label for="inputlg">Large input size</label> <input class="form-control input-lg" id="inputlg" type="text"> </div> <div class="form-group"> <label for="inputsm">Smaller input size</label> <input class="form-control input-sm" id="inputsm" type="text"> </div> </form> </div> </body> </html>The output displays regular, large and smaller inputs: |
|