INTRODUCTION:-
Bootstrap is framework of HTML,CSS and JavaScript for developing responsive websites. It is free to use and download. It is front end framework which makes web development faster and easier. It have many HTML and CSS based templates for forms,buttons,tables etc.
HISTORY:-
Bootstrap was developed by Mark Otto and Jacob Thorton. It was first released as an open source in August 2011.
ADVANTAGES:-
- Bootstrap is very easy to use.
- Anyone who have basic knowledge of HTML and CSS can use it very easily.
- It help users to develop responsive websites very easily.
- Bootstrap is compatible on most of the browser.
BOOTSTRAP CONTAINER:-
The container class is used to create boxed content.
Example:-
- <html>
- <body>
- <div class=“container”>
- <div class=“row”>
- <div class=“col-md-xx”></div>
- …
- </div>
- <div class=“row”>
- <div class=“col-md-xx”></div>
- …
- </div>
- </div>
- </body>
- </html>
BOOTSTRAP JUMBTRON:-
The jumptron is used to specify big box for getting extra attention. It is a box with rounded corner. It is used in <div>.
Example:-
- <!DOCTYPE html>
- <html lang=“en”>
- <head>
- <title>Bootstrap Example</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.6/css/bootstrap.min.css”>
- </head>
- <body>
- <div class=“container”>
- <div class=“jumbotron”>
- <h1>This is Jumbotron inside container!</h1>
- <p>Jumbotron specifies a big box for getting extra attention to some special content or information.</p>
- </div>
- <p>This is some text.</p>
- <p>This is another text.</p>
- </div>
- <script src=“https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js”></script>
- <script src=“https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js”></script>
- </body>
- </html>
BOOTSTRAP BUTTONS:-
There are 7 buttons present in boot strap:
- .btn-primary
- .btn-default
- .btn-info
- .btn-danger
- .btn-link
- .btn-warning
- .success
Example:-
- <!DOCTYPE html>
- <html lang=“en”>
- <head>
- <title>Job</title>
- <link rel=“stylesheet” href=“https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css”/>
- </head>
- <body>
- <h1>Button Example!</h1>
- <button class=“btn btn-default”>default</button>
- <button class=“btn btn-primary”>primary</button>
- <button class=“btn btn-danger”>danger</button>
- <button class=“btn btn-success”>success</button>
- <button class=“btn btn-info”>info</button>
- <button class=“btn btn-warning”>warning</button>
- <button class=“btn btn-link”>Link</button>
- <script src=“https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js”></script>
- <script src=“https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js”></script>
- </body>
- </html>
Classes for button size:-
- .btn-lg
- .btn-md
- .btn-sm
- .btn-xs
BOOTSTRAP TABLES:-
We can use bootstrap to design different types or table.
Example:-
- <!DOCTYPE html>
- <html lang=“en”>
- <head>
- <title>Job</title>
- <link rel=“stylesheet” href=“https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css”/>
- </head>
- <body>
- <div class=“container”>
- <h1>Basic Table Example</h1>
- <table class=“table”>
- <tr><th>Id</th><th>Name</th><th>Age</th></tr>
- <tr><td>101</td><td>Rahul</td><td>23</td></tr>
- <tr><td>102</td><td>Umesh</td><td>22</td></tr>
- <tr><td>103</td><td>Max</td><td>29</td></tr>
- <tr><td>104</td><td>Ajeet</td><td>21</td></tr>
- </table>
- </div>
- <script src=“https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js”></script>
- <script src=“https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js”></script>
- </body>
- </html>
- <tr> is used for table row.
- <td> is used for table data.
- <th> is used for table heading.
BOOTSTRAP FORMS:-
There are three types of forms in bootstrap.
- Horizontal form
- Vertical form
- Inline form
Example 1( vertical form):-
- <!DOCTYPE html>
- <html lang=“en”>
- <head>
- <title>Bootstrap example</title>
- <link rel=“stylesheet” href=“https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css”/>
- </head>
- <body>
- <div class=“container”>
- <h1>Vertical Form Example</h1>
- <form style=“width:300px”>
- <div class=“form-group”>
- <label for=“exampleInputEmail1”>Email address</label>
- <input type=“email” class=“form-control” id=“exampleInputEmail1” placeholder=“Email”>
- </div>
- <div class=“form-group”>
- <label for=“exampleInputPassword1”>Password</label>
- <input type=“password” class=“form-control” id=“exampleInputPassword1” placeholder=“Password”>
- </div>
- <button type=“submit” class=“btn btn-default”>Login</button>
- </form>
- </div>
- <script src=“https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js”></script>
- <script src=“https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js”></script>
- </body>
- </html>
Horizontal form:-
- <!DOCTYPE html>
- <html lang=“en”>
- <head>
- <title>Bootstrap Example</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.6/css/bootstrap.min.css”>
- </head>
- <body>
- <div class=“container”>
- <h2>Horizontal form Example</h2>
- <form class=“form-horizontal” role=“form”>
- <form style=“width:300px”>
- <div class=“form-group”>
- <label class=“control-label col-sm-2” for=“email”>Email:</label>
- <div class=“col-sm-10”>
- <input type=“email” class=“form-control” id=“email” placeholder=“Enter email”>
- </div>
- </div>
- <div class=“form-group”>
- <label class=“control-label col-sm-2” for=“pwd”>Password:</label>
- <div class=“col-sm-10”>
- <input type=“password” class=“form-control” id=“pwd” placeholder=“Enter password”>
- </div>
- </div>
- <div class=“form-group”>
- <div class=“col-sm-offset-2 col-sm-10”>
- <button type=“submit” class=“btn btn-default”>Submit</button>
- </div>
- </div>
- </form>
- </div>
- <script src=“https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js”></script>
- <script src=“https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js”></script>
- </body>
- </html>
Inline form:-
- <!DOCTYPE html>
- <html lang=“en”>
- <head>
- <title>Bootstrap Example</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.6/css/bootstrap.min.css”>
- </head>
- <body>
- <div class=“container”>
- <h2>Inline form Example</h2>
- <form class=“form-inline” role=“form”>
- <form style=“width:300px”>
- <div class=“form-group”>
- <label for=“exampleInputEmail1”>Email address</label>
- <input type=“email” class=“form-control” id=“exampleInputEmail1” placeholder=“Email”>
- </div>
- <div class=“form-group”>
- <label for=“exampleInputPassword1”>Password</label>
- <input type=“password” class=“form-control” id=“exampleInputPassword1” placeholder=“Password”>
- </div>
- <button type=“submit” class=“btn btn-default”>Login</button>
- </form>
- </div>
- <script src=“https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js”></script>
- <script src=“https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js”></script>
- </body>
- </html>
- CSS border-spacing property - July 26, 2021
- CSS border- collapse property - July 26, 2021
- CSS tutorial (CSS Border-radius) - July 22, 2021