Bootstrap is the most popular front-end framework for developing responsive mobile first projects on the web in a much easier way. It uses HTML5, CSS, and Java Script. Bootstrap is completely free to download and use! Today, I am going to talk about the basics of Bootstrap and will go through the basic pillars of Bootstrap. Bootstrap is basically a collection of CSS + Java Script files; with the help of these libraries our normal HTML page becomes a responsive UI. To make a responsive UI we have to add our custom CSS file but with the help of the Bootstrap library you can easily make a great foundation for mobile first responsive UI. One point to remember: You still need to create your customer Css file in order to make flawless awesome web pages, or else it will be like any other Bootstrap website on the internet. Bootstrap is made using classes, and use them when you need them in your website.
- Bootstrap Css library takes care of our UI to make it interactive mobile + desktop enable website, even developer can create a full furnished jaw dropping website easily.
- The speed of development can be increased with the help of Bootstrap.
- As with increase in mobile first website designer need to work a lot in order to make the UI adapt with all kind of devices, where as with the help of bootstrap this overhead has been reduced to quite extend.
- Responsive Grid: As you go in depth of bootstrap and read about Grid you will see that 12 columns are grids are responsive and can adjust them self according to the device.
- There are huge list of Components Dropdown menu, badges etc. Few have been discussed in this article.
- Easy to read documentation: I personally believe if you want to learn Bootstrap from scratch http://getbootstrap.com/ documentation is easy and great to start with. I personally appreciate their efforts we can go back to the site whenever we want something needed in our View.
- Themes: Bootstrap provide free colorful themes that can be used in our Web Application.
- Support
- Installing Bootstrap
- Grid System
- Break Points
- Container
- Nesting Columns
- Offsetting Columns
- Push/ Pull
- Typography Classes
- Alignment Classes
- Tables
- Buttons
- Forms (Horizontal, Inline)
- List Group
- Drop Down
Installing Bootstrap
Go to http://getbootstrap.com/

Image source: getbootstrap.com
Click on download.

Image source: http://getbootstrap.com/
If in production you want to use CDN (Content Delivery Network) we can use the following mentioned CDN links:

Image source: getbootstrap.com
For Bootstrap UI Demo, I am going to use Visual Studio IDE. Visual studio is Microsoft Integrated Development Environment for developing all kinds of applications for Microsoft and other platforms.
Create New Project

Select Empty

Add new Item and add HTML page

If you are using MVC or Web Forms templates, Bootstrap libraries are by default loaded into script and content folders as shown below. Here I am going to use an empty template as mentioned above.

If you are trying without using Visual Studio IDE you need to download bootstrap from the above mentioned links, or else you can download the CDN links as well. So I am going to copy the CDN Links from the website and paste it in my UI view.

CDN Links of Bootstrap
- <!-- Latest compiled and minified CSS -->
- < link rel = "stylesheet"
- href = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
- integrity = "sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7"
- crossorigin = "anonymous" >
- <!-- Optional theme -->
- < link rel = "stylesheet"
- href = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css"
- integrity = "sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r"
- crossorigin = "anonymous" >
- <!-- Latest compiled and minified JavaScript -->
- < script src = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"
- integrity = "sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS"
- crossorigin = "anonymous" > < /script>
So I will just copy the CDN link.
Paste the CDN link to the UI
- <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.10.2.min.js"></script>
Our View
- <html>
- <head>
- <!-- Latest compiled and minified CSS -->
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
- <!-- Optional theme -->
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
- <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.10.2.min.js">
- </script>
- <!-- Latest compiled and minified JavaScript -->
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous">
- </script>
- </head>
- <body>
- <h2>Index</h2>
- <input id="btnSubmit" type="submit" value="Click Me" class="btnbtn-danger" />
- </body>
- </html>

We can see our Bootstrap is working properly; See Button with background color red.
Let’s check whether Jquery is working or not -- I wrote a simple javascript confirm() method to display a dialog box.
- <inputid="btnSubmit"type="submit"value="Click Me"class="btnbtn-danger"onclick="returnconfirm('Getting started with Bootstrap');"

Installing Bootstrap Offline: You can download Bootstrap library from getBootstrap.com if you are not using Visual studio else you can download the same from NUGET package manager as shown below.

Here I am going to download Bootstrap from Nuget Package manager and now see I have three folders added to my project.
- Content
- Font
- Scripts

So now we can easily use the fonts, css, scripts in our UI. Now I am going to use local Bootstrap which we have downloaded.
- <html>
- <head>
- <linkhref="Content/bootstrap-theme.min.css" rel="stylesheet" />
- <linkhref="Content/bootstrap.min.css" rel="stylesheet" />
- <scriptsrc="Scripts/jquery-1.9.1.min.js">
- </script>
- <scriptsrc="Scripts/bootstrap.min.js">
- </script>
- </head>
- <body>
- <h2>Index</h2>
- <inputid="btnSubmit" type="submit" value="Click Me" class="btnbtn-danger" onclick="returnconfirm('Getting started with Bootstrap');" />
- </body>
- </html>

It works as expected.
So let’s start and cover our Basic agendas of the articles one by one:
Grid system:
Bootstrap includes mobile first Grid system which means it has been made out of 12 column responsive grids.

So you can think it as a table as a normal rows and columns that is your content. Here we have 12 columns, the more rows we have the longer our website is from top to bottom. We can use as many columns we want to choose from the 12 columns. But if we increase the count from 12 all the rest columns expect 12 will come to new line.
Eg:
- One column which takes all 12 columns.

- 2 Columns with take 6 columns each,

- 2 Columns with 2 and 10 columns,

- We can create our custom neededversion based upon your need
Note: If we create a 13th column, that will automatically take a new line, you can test the same.
Desktop View

Mobile View

BREAK POINTsin Bootstrap
The grid created applies to the devices screen width greater than or equal to the break point sizes. The way we want to display our website to the devices (desktops, tablets and phones) we use Breakpoints. We have 4 sets of Breakpoints:
- Large Devices Desktop screen >= 1200 px
- Medium devices (old desktops) >=992px
- Small devices Tablets >=768 px
- Extra small devices <768 px
Let get started with sample grid,
- <html>
- <head>
- <linkhref="Content/bootstrap-theme.min.css" rel="stylesheet" />
- <linkhref="Content/bootstrap.min.css" rel="stylesheet" />
- <scriptsrc="Scripts/jquery-1.9.1.min.js">
- </script>
- <scriptsrc="Scripts/bootstrap.min.js">
- </script>
- </head>
- <body>
- <divclass="container">
- <!--class="row" for adding a row -->
- <divclass="row">
- <!--class="col-length-1"> col-length-1 depends upon how much of 12 column grid do you want to use depending upon
- your need 1 means it will use 1 column width
- we can add a second css class by giving space
- bg-success will give Green color to this column
- -->
- <divclass="col-length-1 bg-success">Hey</div>
- <divclass="col-length-1 bg-danger">i</div>
- <divclass="col-length-1 bg-info">am</div>
- <divclass="col-length-1 bg-warning">Bootstrap.</div>
- <divclass="col-length-1 bg-primary">Bootstrap</div>
- <divclass="col-length-1 bg-success">is</div>
- <divclass="col-length-1 bg-danger">the </div>
- <divclass="col-length-1 bg-info">most </div>
- <divclass="col-length-1 bg-warning">popular.</div>
- <divclass="col-length-1 bg-primary">HTML</div>
- <divclass="col-length-1 bg-warning">CSS</div>
- <divclass="col-length-1 bg-danger">JSsframework</div>
- </div>
- </div>
- <h2>Index</h2>
- <inputid="btnSubmit" type="submit" value="Click Me" class="btnbtn-danger" onclick="returnconfirm('Getting started with Bootstrap');" />
- </body>
- </html>
Bootstrap needs Container to wrap site content elements.
There are two types of Container:
- <divclass="container"> ... </div>: Responsive fixed width
- <divclass="container-fluid">full width

- <divclass="container-fluid"> ... </div>full width container spanning entire viewport.

As a simple grid content we should follow certain rules,
- Rows should be placed inside a container as mentioned above i.e.( <divclass="container"> or <divclass="container-fluid">)
- Use rows to created horizontalcolumns<divclass="row">
- Columns should be immediate children of rows<divclass="col-length-1 bg-success">Hey</div>
- If you add more than 12th grid column the 13th and vice versa will automatically take a new line.


- But we can see the webpage is not showing appropriatly in mobile devices. You might be wondering if I am making a fool of you that it's responsive. Let’s make them Mobile first enable UI.
- So if we want our columns to simply stack in smaller devices, use the extra small and medium device grid classes col-xs-* col-sm-*to your columns as shown below.

Let make it little bit more cleared by makingcol-xs-1 col-sm-1 to col-xs-4 col-sm-4,- <!--class="row" for adding a row -->
- <divclass="row">
- <!--class="col-length-1"> col-length-1 depends upon how much of 12 column grid do you want to use depending upon
- your need 1 means it will use 1 column width
- we can add a second css class by giving space
- bg-success will give Green color to this column
- -->
- <divclass="col-length-1 col-xs-1 col-sm-1 bg-success">Hey</div>
- <divclass="col-length-1 col-xs-1 col-sm-1 bg-danger">i</div>
- <divclass="col-length-1 col-xs-1 col-sm-1 bg-info">am</div>
- <divclass="col-length-1 col-xs-1 col-sm-1 bg-warning">Bootstrap.</div>
- <divclass="col-length-1 col-xs-1 col-sm-1 bg-primary">Bootstrap</div>
- <divclass="col-length-1 col-xs-1 col-sm-1 bg-success">is</div>
- <divclass="col-length-1 col-xs-1 col-sm-1 bg-danger">the </div>
- <divclass="col-length-1 col-xs-1 col-sm-1 bg-info">most </div>
- <divclass="col-length-1 col-xs-1 col-sm-1 bg-warning">popular.</div>
- <divclass="col-length-1 col-xs-1 col-sm-1 bg-primary">HTML</div>
- <divclass="col-length-1 col-xs-1 col-sm-1 bg-warning">CSS</div>
- <divclass="col-length-1 col-xs-1 col-sm-1 bg-danger">JSsframework</div>
- </div>

- <divclass="container-fluid">
- <!--class="row" for adding a row -->
- <divclass="row">
- <!--class="col-length-1"> col-length-1 depends upon how much of 12 column grid do you want to use depending upon
- your need 1 means it will use 1 column width
- we can add a second css class by giving space
- bg-success will give Green color to this column
- -->
- <divclass="col-length-1 col-xs-4 col-sm-4 bg-success">Hey</div>
- <divclass="col-length-1 col-xs-4 col-sm-4 bg-danger">i</div>
- <divclass="col-length-1 col-xs-4 col-sm-4 bg-info">am</div>
- <divclass="col-length-1 col-xs-4 col-sm-4 bg-warning">Bootstrap.</div>
- <divclass="col-length-1 col-xs-4 col-sm-4 bg-primary">Bootstrap</div>
- <divclass="col-length-1 col-xs-4 col-sm-4 bg-success">is</div>
- <divclass="col-length-1 col-xs-4 col-sm-4 bg-danger">the </div>
- <divclass="col-length-1 col-xs-4 col-sm-4 bg-info">most </div>
- <divclass="col-length-1 col-xs-4 col-sm-4 bg-warning">popular.</div>
- <divclass="col-length-1 col-xs-4 col-sm-4 bg-primary">HTML</div>
- <divclass="col-length-1 col-xs-4 col-sm-4 bg-warning">CSS</div>
- <divclass="col-length-1 col-xs-4 col-sm-4 bg-danger">JSsframework</div>
- </div>
- </div>

class="col-length-1 col-xs-4 col-sm-4 bg-success" means if it’s is a large screen we want to take it as one column, if it’s small we want it to be 4 and lastly for extra small also 4 columns.
Note: If we want our UI to be responsive for all the break points we have to define all sets of break in proper formats.
- <divclass="row">
- <!--class="col-length-1"> col-length-1 depends upon how much of 12 column grid do you want to use depending upon
- your need 1 means it will use 1 column width
- we can add a second css class by giving space
- bg-success will give Green color to this column
- -->
- <divclass="col-length-1 col-xs-4 col-sm-2 bg-success">Hey</div>
- <divclass="col-length-1 col-xs-4 col-sm-2 bg-danger">i</div>
- <divclass="col-length-1 col-xs-4 col-sm-2 bg-info">am</div>
- <divclass="col-length-1 col-xs-4 col-sm-2 bg-warning">Bootstrap.</div>
- <divclass="col-length-1 col-xs-4 col-sm-2 bg-primary">Bootstrap</div>
- <divclass="col-length-1 col-xs-4 col-sm-2 bg-success">is</div>
- <divclass="col-length-1 col-xs-4 col-sm-2 bg-danger">the </div>
- <divclass="col-length-1 col-xs-4 col-sm-2 bg-info">most </div>
- <divclass="col-length-1 col-xs-4 col-sm-2 bg-warning">popular.</div>
- <divclass="col-length-1 col-xs-4 col-sm-2 bg-primary">HTML</div>
- <divclass="col-length-1 col-xs-4 col-sm-2 bg-warning">CSS</div>
- <divclass="col-length-1 col-xs-4 col-sm-2 bg-danger">JSsframework</div>
- </div>
Nesting columns
Nesting your content inside a Grid: Add a new row with col-lg-9. It’s is not required to always use 12 columns.
- <divclass="container">
- <!--class="row" for adding a row -->
- <divclass="row">
- <divclass="col-sm-4 bg-danger text-center">
- <p>1st div </p>
- <divclass="row">
- <divclass="col-lg-8 bg-success text-center" ">
- <p>Nested div</p>
- </div>
- <divclass="col-lg-4 bg-success text-center "">
- <p>Nested div</p>
- </div>
- </div>
- </div>
- <divclass="col-sm-4 bg-success text-center" ">
- <p>2nd div </p>
- <divclass="row ">
- <divclass="col-lg-8 bg-warning text-center "">
- <p>Nested div</p>
- </div>
- <divclass="col-lg-4 bg-info text-center" ">
- <p>Nested div</p>
- </div>
- </div>
- </div>
- </div>
- </div>

Offsetting columns
What If I want my 2nd div to be on right hand side and 1st div in extreme left? Than we make use of Offset class. Move column to the right using .col-md-offset-4. These classes increase the left margin of a column.
- <divclass="container">
- <!--class="row" for adding a row -->
- <divclass="row">
- <divclass="col-sm-4 bg-danger text-center">
- <p>1st div </p>
- <divclass="row">
- <divclass="col-lg-8 bg-success text-center" ">
- <p>Nested div</p>
- </div>
- <divclass="col-lg-4 bg-success text-center "">
- <p>Nested div</p>
- </div>
- </div>
- </div>
- <divclass="col-sm-4 bg-success text-center col-sm-offset-4">
- <p>2nd div </p>
- <divclass="row">
- <divclass="col-lg-8 bg-warning text-center" ">
- <p>Nested div</p>
- </div>
- <divclass="col-lg-4 bg-info text-center "">
- <p>Nested div</p>
- </div>
- </div>
- </div>
- </div>
- </div>



Typography Classes in Bootstrap:


















Prasanna MuraliPosted May 20, 2016, 11:20 AM
Nice one....
jo paulPosted May 1, 2016, 1:22 AM
Very useful resource to bookmark for bootstrap
Bhuvanesh MohankumarPosted Apr 30, 2016, 3:09 PM
Good one...
Gowtham RajamanickamPosted Apr 9, 2016, 9:35 AM
Good one..
Ratnesh SinghPosted Apr 1, 2016, 10:04 AM
nice....
Vivek KumarPosted Mar 27, 2016, 2:58 PM
Nice share
Pramod ThakurPosted Mar 22, 2016, 3:08 AM
Good...
Humayun Kabir MamunPosted Mar 2, 2016, 11:06 PM
Nice...
Suraj PantPosted Mar 2, 2016, 1:48 PM
Nice share
Ammar ShaukatPosted Mar 1, 2016, 12:52 PM
You're hardworking guy.. keep it up young man
Vignesh ManiPosted Mar 1, 2016, 5:43 AM
Good one
Ranjit PowarPosted Mar 1, 2016, 3:22 AM
Nice article
Mahesh ChandPosted Mar 1, 2016, 12:25 AM
Agreed. Job well done. Very detailed.
Amit Kumar SinghPosted Feb 29, 2016, 11:56 PM
Good One
Thiru RPosted Feb 29, 2016, 11:25 PM
Fantastic. Thanks for your share.
Ankur MistryPosted Feb 29, 2016, 8:49 PM
Very nice
Asfend YarPosted Feb 29, 2016, 1:58 PM
is this enough for bootstrap
Gowtham KPosted Feb 29, 2016, 11:15 AM
Good One
Pankaj Kumar ChoudharyPosted Feb 29, 2016, 11:15 AM
Nice Explain Saillesh , +5 for efforts
Asfend YarPosted Feb 29, 2016, 10:25 AM
nice share