Question 1: What is Bootstrap?
Answer
Bootstrap is the most popular and powerful HTML, CSS, and JavaScript front-end framework for faster and easier use, responsive layout, and mobile-first web development. It includes design templates for UI components like Forms, Buttons, Tables, Navigation, Dropdowns, Alerts, Tabs, Accordion, Carousel and many others with optional JavaScript plugins.
Features of Bootstrap
- Easy to use
Bootstrap is very easy to use. Anyone with the basic knowledge of HTML and CSS can start development with Bootstrap. - Open Source
Bootstrap is completely free to download and use. - Browser compatibility
Bootstrap is compatible with all modern browsers like Google Chrome, Mozilla Firefox, Internet Explorer, Safari, and Opera. - Responsive features
By using Bootstrap we can easily create responsive designs for web pages. Bootstrap's responsive CSS makes our web pages appear more appropriately on different devices as it adjusts to phones, tablets, and desktops.
For more details visit the following link,
Question 2: Why choose Bootstrap for building websites?
Answer
Bootstrap is used for building websites for the following reasons,
- Mobile First Approach: Since Bootstrap 3, the framework consists of Mobile first styles throughout the entire library instead of in separate files.
- Browser Support: It is supported by all popular browsers.
- Easy to Get Started: With just the knowledge of HTML and CSS anyone can get started with Bootstrap.
- Responsive Design: Bootstrap's responsive CSS adjusts to Desktops, Tablets and Mobiles.
- Provides a clean and uniform solution for building an interface for developers.
- It contains beautiful and functional built-in components that are easy to customize. It also provides web based customization.
For more details visit the following link,
Question 3: Explain the use of Bootstrap CSS class="navnav-list".
Answer
You need to add the nav-list class in addition to the nav class that will make it look like a list. And adding class nav-header to any element of the nav class will make it look like a heading to the section of links. The HTML File looks as in the following,
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<link href="Bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
<script src="Bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
</head>
<body>
<ul class="navnav-list">
<li class="nav-header">Category</li>
<li><a href="#">.NET</a></li>
<li><a href="#">ASP.NET</a></li>
<li><a href="#">Silverlight</a></li>
<li><a href="#">WCF</a></li>
<li class="nav-header">Database</li>
<li><a href="#">SQL Server</a></li>
<li><a href="#">Oracle</a></li>
<li><a href="#">MySQL</a></li>
</ul>
</body>
</html>
Now see how the list is rendering.

For more details visit the following link -
Question 4: Explain Bootstrap Grid System.
Answer
Bootstrap grid system provides the fastest and easiest way to create layouts of web pages. It introduces the responsive mobile first fluid grid system that appropriately scales up to 12 columns as the device or view port size increases. It includes predefined grid classes for making grid layouts for various types of devices, like phones, tablets, desktop, and so on, as well as powerful mixings for generating more semantic layouts.
The Grid Sizes
It has four tiers of classes: xs, sm, md and lg. You can use any combination of these classes to create more dynamic and flexible layouts. The following is the breakdown of the various sizes of these classes.
| Classes | Devices | Size |
| .col-xs-* | Extra Small Phones | Less than 768px |
| .col-sm-* | Small Devices Tablets | 768px and Up |
| .col-md-* | Medium Devices Desktops | 992px and Up |
| .col-lg-* | Large Devices Large Desktops | 1200px and Up |
Structure of Bootstrap Grid Layout,

Working of Bootstrap Grid System
Grid systems are used for creating page layouts through a series of rows and columns . Here's how the Bootstrap grid system works,
- Rows must be placed within a .container and .container-fluid class for proper alignment and padding.
- Use rows to create horizontal groups of columns.
- Content should be placed within columns and only columns may be immediate children of rows.
- Predefined grid classes like .row and .col-xs-4 are available for quickly making grid layouts. LESS mixings can also be used for more semantic layouts.
- Grid columns are created by specifying the number of twelve available columns you wish to span. For example, three equal columns would use three .col-xs-4.
For more details visit the following link,
Question 5: How can you get Bootstrap?
Answer
There are two ways to get Bootstrap on our own web site.
- Download Bootstrap.
- Include Bootstrap from a CDN.
Download Bootstrap
We can download the latest version of Bootstrap. When we click on this link we will see screen like this.

Now if we click on the Download Bootstrap button, another page will open like this:

There are two versions available for download, compiled Bootstrap and Bootstrap source files.
- Download Bootstrap
By clicking on this option, we can download the precompiled and minified versions of Bootstrap CSS, JavaScript, and fonts.
After downloading, we will unzip the folder and we will find the following subfolders inside that.

- Download Source
By clicking on this option, we can get the latest Bootstrap LESS and JavaScript source code.
For better understanding we'll focus on the compiled Bootstrap files. As the files are compiled and minified we don't have to bother every time including separate files for individual functionality. It will also increase the performance of our website.
Bootstrap CDN
If we don't want to download, we can include it from a CDN (Content Delivery Network). MaxCDN provides CDN support for Bootstrap's CSS and JavaScript and also includes jQuery. We can use Bootstrap CDN links,
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
For more details visit the following link,
Question 6: What do you understand about Responsive websites?
Answer
The first understanding of Responsive websites that comes to a beginner's mind is that responsive means a website that responds to a user. But actually, responsiveness here means that a website is designed in such a way that it can be used on any platform whether it is a large desktop, laptop, tablet or mobile.
So a responsive website actually is one that responds to the changing width and height of a device or screen.
Benefits of a responsive website
- We all know that in today's world, all of the business work can be done using a small device like a tablet or a mobile. So it makes it easier for the user to access the website using a device, thus, increasing the user base and traffic on a website.
- When the user base increases, it also adds to the increase in the business of the website and the product sale will also increase.
- Makes it easy for an organization to analyze the user base and its productivity.
- Increase in the visibility in search engines. This is the major part of the success of an organization.
- Save time and cost on mobile development.
For more details visit the following link -
Question 7: How can you create a web page using Bootstrap?
Answer
Example:
Using Downloaded Bootstrap
Now we will create an HTML file that displays a "Hello C# Corner" message in our web browser.
Step 1
Creating a Basic HTML file.
First we will open any code editor and create a new html file, and we will write the following code and then save the file name as "hello.html" on the particuler location. We will include HTML5 doctype at the beginning of the page, with the lang attribute and the correct character set.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap Part1</title>
</head>
<body>
<h1>Hello C# Corner</h1>
</body>
</html>
Step 2
Bootstrap 3 is mobile-first.
Using Bootstrap 3 we will design our HTML page to be responsive to mobile devices. To ensure proper rendering and enable touch zooming, we will add the following <meta> tag inside the <head> element.
<meta name="viewport" content="width=device-width,initial-scale=1">
The width=device-width is used to set the width of the page to follow the screen-width of the device. The initial-scale=1 is used to set the initial zoom level when the page is first loaded by the browser.
Now the code will look like this.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap Part1</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body>
<h1>Hello C# Corner</h1>
</body>
</html>
Step 3
Making an HTML File a Bootstrap Template.
For making this file a Bootstrap Template, after Downloading Bootstrap by the above procedure we will include Bootstrap CSS and JS files. We should include JS files at the bottom of the HTML page before closing <body> tag. by the following code.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap Part1</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
</head>
<body>
<h1>Hello C# Corner</h1>
<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
Now we will open the file in a browser by double clicking on it and see the output.
Output

For more details visit the following link -
Question 8: How can you create Fixed Layout with Bootstrap?
Answer
With Bootstrap you can create layouts of web pages based on a fixed number of pixels. To create the fixed yet responsive layout you should start the container with the .container class. Then create the row with the .row class to wrap the horizontal groups of columns. Rows must be placed within a container for proper alignment and padding. Further columns can be created within rows using the predefined grid classes like .col-xs-*, .col-sm-*, .col-md-* and .col-lg-* where * represents a grid number.
The following code creates a fixed width responsive layout that is 970px wide on a medium device like desktop and laptop with a screen width ≥992px and 1170px wide on large devices like large desktops with a screen width ≥1200px. However the layout width will be automatically calculated for devices that have a screen width <768px like tablets and cell phones.
HTML Code
<!DOCTYPE html >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Fixed Layout with Bootstrap</title>
<!-- compiled and minified CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="css/bootstrap-theme.min.css">
</head>
<body>
<div class="container">
<div class="jumbotron">
<h1>Fixed Layout with Bootstrap </h1>
<p>With Bootstrap you can create layouts of web pages based on fixed number of pixels. To create the fixed yet responsive layout you should starts container with the .container class. After that create row with the .row class to wrap the horizontal groups of columns. Rows must be placed within a container for proper alignment and padding. Further columns can be create within rows using the predefined grid classes like .col-xs-*, .col-sm-*, .col-md-* and .col-lg-* where * represent grid number.</p>
</div>
<div class="row">
<div class="col-sm-4">
<h2>HTML</h2>
<p>HTML is a markup language that is used for creating web pages. The HTML tutorial section will help you understand the basics of HTML, so that you can create your own web pages or website.</p>
</div>
<div class="col-sm-4">
<h2>CSS</h2>
<p>CSS is used for describing the presentation of web pages. The CSS tutorial section will help you learn the essentials of CSS, so that you can fine control the style and layout of your HTML document.</p>
</div>
<div class="col-sm-4">
<h2>Bootstrap</h2>
<p>Bootstrap is a powerful front-end framework for faster and easier web development. The Bootstrap tutorial section will help you learn the techniques of Bootstrap so that you can quickly create your own website.</p>
</div>
</div>
<hr>
</div>
<!-- compiled and minified JavaScript -->
<script type="text/javascript" src="js/bootstrap.min.js"></script>
</body>
</html>
Result On a tablet, desktop and larger device,

Mobile Device

For more details visit the following link -
Question 9: How can we create a dropdown menu in Bootstrap?
Answer
To make the menu more attractive with a DropDown list using Bootstrap open up the bootstrap.css file and check out the following Bootstrap CSS class.
- Caret Class
- DropDown-Menu Class
1. Using bootstrap CSS class="Caret"
Now first we use the caret class with li tag. The Caret class shows a caret sign. Now open the bootstrap.css file and find the .navbar-inverse class. It looks like this,
.caret
{
display: inline - block;
width: 0;
height: 0;
margin - left: 2 px;
vertical - align: middle;
border - top: 4 px solid;
border - right: 4 px solid transparent;
border - left: 4 px solid transparent;
}
The HTML file looks as in the following,
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<link href="Bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
<script src="Bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
</head>
<body>
<div class="navbar-inverse">
<div class="Container">
<ul class="navnavbar-nav">
<li><a href="#">Home</a></li>
<li><a href="#about">Technologies</a></li>
<li><a href="#contact">Article</a></li>
<li><a href="#contact">blog</a></li>
<li><a href="#contact">News <b class ="caret"></b></a></li>
</ul>
</div>
</div>
</body>
</html>
The HTML will render without Bootstrap as in the following:

2. Using bootstrap CSS class="DropDown-Menu"
You now need to add the DropDown-Menu class. Now open the bootstrap.css file and find the DropDown-Menu class. It looks like this,
.dropdown - menu
{
position: absolute;
top: 100 % ;
left: 0;
z - index: 1000;
display: none;
float: left;
min - width: 160 px;
padding: 5 px 0;
margin: 2 px 0 0;
font - size: 14 px;
list - style: none;
background - color: #ffffff;
border: 1 px solid# cccccc;
border: 1 px solid rgba(0, 0, 0, 0.15);
border - radius: 4 px; -
webkit - box - shadow: 0 6 px 12 px rgba(0, 0, 0, 0.175);
box - shadow: 0 6 px 12 px rgba(0, 0, 0, 0.175);
background - clip: padding - box;
}
The HTML file looks as in the following,
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<link href="Bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
<script src="Bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="Bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="Bootstrap/js/bootstrap.js" type="text/javascript"></script>
</head>
<body>
<div class="navbarnavbar-inverse">
<div class="Container">
<ul class="navnavbar-nav">
<li><a href="#">Home</a></li>
<li><a href="#about">Technologies</a></li>
<li><a href="#contact">Article</a></li>
<li><a href="#contact">blog</a></li>
<li class="dropdown"><a href="#" class="dropdown-toggle">News <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Home</a></li>
<li><a href="#">Technologies</a></li>
<li><a href="#">Article</a></li>
<li><a href="#">blog</a></li>
</ul>
</li>
</ul>
</div>
</div>
<script src="Bootstrap/js/jquery.js" type="text/javascript"></script>
<script src="Bootstrap/js/dropdown.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.dropdown-toggle').dropdown();
});
</script>
</body>
</html>
The HTML will be rendered with Bootstrap as in the following,

For more details visit the following link -
Question 10: How can you create a menu using navbar-inverse in Bootstrap?
Answer
First create a list using ul and li tags. The HTML file looks as in the following,
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<link href="Bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
<script src="Bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
</head>
<body>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#about">Technologies</a></li>
<li><a href="#contact">Article</a></li>
<li><a href="#contact">blog</a></li>
<li><a href="#contact">News</a></li>
</ul>
</body>
</html>
HTML will render without Bootstrap as in the following,

Using bootstrap CSS class="navbar-inverse"
You now need to add the navbar-inverse class.
Now open the bootstrap.css file and find the .navbar-inverse class. It looks like this,
.navbar - inverse
{
background - color: #222222;
border-color: # 080808;
}
Now we want to change the background-color with "background-color: #0029ff".
.navbar-inverse {
background-color: #0029ff;
border-color: #080808;
}
The HTML file looks as in the following,
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<link href="Bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
<script src="Bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
</head>
<body>
<div class="navbar-inverse">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#about">Technologies</a></li>
<li><a href="#contact">Article</a></li>
<li><a href="#contact">blog</a></li>
<li><a href="#contact">News</a></li>
</ul>
</div>
</body>
</html>
The HTML will be rendered with Bootstrap as in the following:

For more details visit the following link -
Question 11: What are the advantages of Bootstrap?
Answer
There are many advantages of using Bootstrap,
- Bootstrap Css library takes care of our UI to make interactive mobile + desktop enabled websites, developers can even create a fully furnished jaw dropping website easily.
- The speed of development can be increased with the help of Bootstrap.
- With the increase in mobile first, website designers need to work a lot in order to make the UI adapt to all kinds of devices, whereas with the help of bootstrap this overhead has been reduced to quite an extent.
- Responsive Grid: As you go in depth with Bootstrap and read about Grid you will see that 12 columns are grids and are responsive and you can make them self-adjusting according to the device.
- There is a huge list of Components -- Dropdown menu, badges etc. A few have been discussed in this article.
- Easy to read documentation: I personally believe if you want to learn Bootstrap from scratch https://getbootstrap.com/ documentation is easy and great to start with. I personally appreciate their efforts we can go back to the site whenever we something is needed in our View.
- Themes: Bootstrap provides free colorful themes that can be used in our Web Application.
- Support
For more details visit the following link,
Question 12: What are Containers in Bootstrap?
Answer
In Bootstrap we can contain elements to wrap site contents.
There are two Bootstrap Container classes,
- The .container class used to provide a responsive fixed width container.
- The .container-fluid class used to provide a full width container.
We have to note that we cannot put a container inside another container since it is not nestable.
Example 1
Using .container class (responsive fixed width container)
In this example we will create a simple Bootstrap page. Using ".container" class we will create a fixed width container that is responsive for different devices. In this we will write some text. We will have some space on the left and right side of the page by writing the following code.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap Part2</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
</head>
<body>
<div class="container">
<h1>This Is Bootstrap Page With Responsive Fixed Width Container</h1>
<p>This Container Show Output Of Using (.container) Class</p>
</div>
<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
Output


Example 2
Using .container-fluid class (full width container)
In this example we will create a simple Bootstrap page like Example 1. Using ".container-fluid"class we will create a full width container. In this we will write some text. Now we will create a page by writing the following code.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap Part2</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
</head>
<body>
<div class="container-fluid">
<h1>This Is Bootstrap Page With Full Width Container</h1>
<p>This Container Show Output Of Using (.container-fluid) Class</p>
</div>
<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
Output

For more details visit the following link -
Question 13: Explain the basic structure of the Bootstrap grid.
Answer
Now for creating rows and columns using 12 column responsive grid systems.
- First we need to create a container that acts as a wrapper for our rows and columns by using the .container class.
- Then we have to create rows inside the container by using (<div class="row">) ,
- Then we need to add the desired number of columns inside any row by using classes .col-xs-*, .col-sm-*, .col-md-* and .col-lg-* the number of columns should always add up to 12 for each row. In these columns we write our contents.
The following is a Basic Structure,

<div class="container">
<div class="row">
<div class="col-*-*">col1</div>
<div class="col-*-*">col2</div>
<div class="col-*-*">col3</div>
</div>
<div class="row">
...
</div>
</div>
Now we will create some examples for Grid Layouts by which we can easily make responsive website layouts.
Example 1
Two Column Layouts
In this example we will create two column layouts for different devices. In mobile the column will automatically arrange horizontally according to screen size. We know that grid system works on 12 columns, so for creating two column layouts we keep the sum of the grid column numbers equal to 12 in each row so columns will be in one line. In this example we will add three rows and inside each row we will add two columns. Let's create the example.
Step 1
First we will create a Bootstrap Template, HTML page named "TwoColLayout.html" by using the following code.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap Part3</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
</head>
<body>
<div class="container">
<h1>Two Column Layouts</h1>
</div>
<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
Step 2
Now we will add rows and columns for creating Two Column Layouts by the following code; in this we will give style "background-color" for each column so output shows clearly.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap Part3</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
</head>
<body>
<div class="container">
<h1>Two Column Layouts</h1>
<!--First row with column number(4,8)-->
<div class="row">
<div class="col-sm-4" style="background-color:#8dc1aa">column1: col-sm-4</div>
<div class="col-sm-8" style="background-color:#808080">column2: col-sm-8</div>
</div>
<!--Second row with column number(6,6)-->
<div class="row">
<div class="col-sm-6" style="background-color:#cfa6e2">column3: col-sm-6</div>
<div class="col-sm-6" style="background-color:#faa76c">column4: col-sm-6</div>
</div>
<!--Third row with column number(3,9)-->
<div class="row">
<div class="col-sm-3" style="background-color:#c8fcfc">column5: col-sm-3</div>
<div class="col-sm-9" style="background-color: #79ad96">column6: col-sm-9</div>
</div>
</div>
<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
Output
See the output for different devices according to screen size.

For more details visit the following link -
Question 14: Explain Bootstrap buttons and its styles.
Answer
Buttons play various roles in websites and applications and are used to submit, reset, show and hide on click of button, link button etc.
By using Bootstrap we can easily create and customize the buttons.
Bootstrap Button Styles
In Bootstrap different classes are used for styling the buttons and styles can be applied to any element like <a>, <button> and <input>.
Bootstrap provides seven styles of buttons,

To apply the button styles, Bootstrap provides the following classes,
- .btn-default - Default gray color Standard button
- .btn-primary - To indicate primary action button
- .btn-info - Used for informational alert messages
- .btn-success - Indicates a successful or positive action
- .btn-danger - Indicates a dangerous or negative action.
- .btn-warning - Indicates caution should be taken with this action
- .btn-link - Button looks like a link while maintaining button behavior
Example
Bootstrap Button Styles,
In this example we will create buttons and by using above classes we will apply styles on buttons through the following code.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap Part4</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"> </head>
<body>
<div class="container">
<h1>Button Styles</h1>
<!--Button Style1:Default--><button type="button" class="btn btn-default">Default Button</button>
<!--Button Style2:Primary--><button type="button" class="btn btn-primary">Primary Button</button>
<!--Button Style3:Info--><button type="button" class="btn btn-info">Info Button</button>
<!--Button Style4:Success--><button type="button" class="btn btn-success">Success Button</button>
<!--Button Style5:Danger--><button type="button" class="btn btn-danger">Danger Button</button>
<!--Button Style6:Warning--><button type="button" class="btn btn-warning">Warning Button</button>
<!--Button Style7:Link--><button type="button" class="btn btn-link">Link Button</button> </div>
<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
Output

For more details visit the following link -
Question 15: Explain the Bootstrap basic table?
Answer
The following table elements are used with Bootstrap,
- <table> - It is used for wrapping element for displaying data in a tabular format
- <thead> - It is used for container element for table header rows (<tr>) to label table columns.
- <tbody> - It is used for container element for table rows (<tr>) in the body of the table.
- <tr> - It is used for container element for a set of table cells (<td> or <th>) that appears on a single row.
- <th> - Special table cell for column (or row) labels. It must be used within a <thread>
- <td> - It is used for default table cell.
- <caption> - It is used for description or summary of what the table holds.
Bootstrap Basic Table
We can create a basic Bootstrap table with basic styling that has a small cell padding and only horizontal dividers by adding Bootstrap class ".table" to the <table> element.
Example
Bootstrap Basic Table using .table class.
In this example we will create a simple table with Bootstrap class and using html table elements we will create an employee table with Fields Sr. No., Employee Name, Email, City by writing the following code.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap Part5</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
</head>
<body>
<div class="container">
<h1>Bootstrap Basic Table</h1>
<!--Bootstrap Basic Table using .table class-->
<table class="table">
<thead>
<tr>
<th>Sr.No.</th>
<th>Emolpyee Name</th>
<th>Email</th>
<th>City</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Shaili Dashora</td>
<td>[email protected] </td>
<td>Chittorgarh</td>
</tr>
<tr>
<td>2</td>
<td>Sourabh Somani</td>
<td>[email protected] </td>
<td>Banglore</td>
</tr>
<tr>
<td>3</td>
<td>Shobhna Singvi</td>
<td>[email protected]</td>
<td>Mumbai</td>
</tr>
</tbody>
</table>
</div>
<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
Output
Basic Table Layout,

For more details visit the following link -
Question 16: How can you give a style to images in Bootstrap?
Answer
By using the Bootstrap classes we can easily style images like making images round, cornered, or circular, or we can give a thumbnail effect on images. We have the following classes for image shapes.
- Rounded Corners - The .img-rounded class used for adding rounded corners to an image.
- Circle - The .img-circle class used for shaping the image to a circle.
- Thumbnail - The .img-thumbnail class used for shaping the image to a thumbnail.
Example - Bootstrap Image Shapes
In this example we will give different shapes of images using the above Bootstrap classes, we will put an image inside images folder where our html page exists. After that, we will give shapes on image: Rounded, Circle, or Thumbnail by using the following code.
Output
Bootstrap Image Shapes,

For more details visit on to following link,
Question 18: What is panel in Bootstrap?
Answer
A panel in bootstrap is a bordered box with some padding around its content. To create a basic panel, we use .panel class to the <div> element, and content inside the panel has a .panel-body class.
Example 1 - Creating Panel
In this example we will create a basic panel by using .panel class to the <div> element and we will write content in the panel by using .panel-body class to the <div> element. In this example we will use .panel-default class for styling of the panel by writing the following code.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap Part7</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
</head>
<body>
<div class="container">
<h2>Bootstrap Panel</h2>
<div class="panel panel-default">
<div class="panel-body">Demo Panel</div>
</div>
</div>
<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
Output

For more details visit the following link -
Question 19: What is Jumbotron in Bootstrap?
Answer
A Jumbotron provides some different look for a heading or we can say it is used to show some special content or information on the webpages, it is displayed as a gray box with rounded corners. It also increase the font sizes of the text inside it. To create a Jumbotron we use <div> element with class.jumbotron.
Creating Jumbotron Inside Container
We place the Jumbotron component by using .jumbotron class inside the <div> with class .container by which it is not extended to the edge of the screen.
Example - Jumbotron Inside Container
In this example we will create a <div> with .container class, inside it we will add one <div> with class.jumbotron and inside jumbotron we can put any HTML, Bootstrap elements for Heading, Descriptions, etc. We will create jumbotron by writing the following code.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap Part8</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
</head>
<body>
<div class="container">
<!--Creating Jumbotron inside container-->
<div class="jumbotron">
<h1>Bootstrap Jumbotron</h1>
<p>It is Bootstrap Jumbotron inside Container</p>
<p><a href="#" class="btn btn-info" role="button">See More Information</a></p>
</div>
</div>
<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
Output Jumbotron inside Container.

For more details visit the following link -
Question 20: Explain the Bootstrap progress bar.
Answer
Now we will create different types of progress bars and see how they are useful for webpages.
Basic Progress Bar
We can create a default progress bar, by adding .progress class to a <div> element.
Example - Creating Default Progress Bar
In this example to create a basic progress bar we will add a <div> with class .progress inside the container, now inside this <div>.
We will add one more <div> with class .progress-bar, we will also add width in style attribute that indicates the progress of task or action.
We will add .sr-only class for Progress Bar,
- .sr-only - It is used to hide an element to all devices except screen readers
We will add following properties for Progress Bar,
- aria-valuenow - It is used to define the current value for a range for Progress Bar
- aria-valuemin - It is used to define the minimum allowed value for a range
- aria-valuemax - It is used to define the maximum allowed value for a range
Let's create an example for Default Progress Bar by writin the following code.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap Part9</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
</head>
<body>
<div class="container">
<h3>Basic Bootstrap Progress Bar (30% Complete)</h3>
<!-- A <div> element with class .progress -->
<div class="progress">
<!-- A <div> element with class .progress-bar -->
<div class="progress-bar" role="progressbar" aria-valuenow="30" aria-valuemin="0" aria-valuemax="100" style="width:30%">
<span class="sr-only">30% Complete Process</span>
</div>
</div>
</div>
<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
Output

For more details visit the following link -
Question 21: What contextual classes are used with progress bars in Bootstrap?
Answer
The contextual classes used with progress bars are:
- .progress-bar-info
- .progress-bar-success
- .progress-bar-danger
- .progress-bar-warning
Creating Progress Bars with Contextual classes
In this example to create Colored Progress Bars we will add <div> with class .progress inside the container, now inside this <div> we will add one more <div> with class .progress-bar and we will add Contextual classes here like .progress-bar-info,.progress-bar-success,.progress-bar-danger,.progress-bar-warning. We will also add width in style attribute that indicates the progress of the task or action. We will also add aria attributes for progress bar, by writing the following code.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap Part9</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
</head>
<body>
<div class="container">
<h3>Colored Progress Bars with Contextual classes</h3>
<div class="progress">
<!-- A <div> element with class .progress-bar and .progress-bar-info -->
<div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="30" aria-valuemin="0" aria-valuemax="100" style="width:30%">
30% Complete Process (Info)
</div>
</div>
<div class="progress">
<!-- A <div> element with class .progress-bar and .progress-bar-success -->
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100" style="width:50%">
50% Complete Process (Success)
</div>
</div>
<div class="progress">
<!-- A <div> element with class .progress-bar and .progress-bar-danger -->
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="70" aria-valuemin="0" aria-valuemax="100" style="width:70%">
70% Complete Process (Danger)
</div>
</div>
<div class="progress">
<!-- A <div> element with class .progress-bar and .progress-bar-warning -->
<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="90" aria-valuemin="0" aria-valuemax="100" style="width:90%">
90% Complete Process (Warning)
</div>
</div>
</div>
<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
Output

For more details visit the following link -
Question 22: Explain Bootstrap Basic Buttons.
Answer
The basic list group is like an unordered list with list items. For creating a Basic List Group use class .list-group to <ul> element, and into this <li> elements.
Example - Basic List Groups
In this example first we will create a <div> with class .container, then for Basic List Group, we will add <ul> element with class .list-group and inside this we will add <li> elements with class .list-group-item, and in this we will add elements of list.
Let’s create a Basic List Group by writing the following code and see the output.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap Part10</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
</head>
<body>
<div class="container">
<h3>Basic Bootstrap List Group</h3>
<p>FOOD CATEGORY</p>
<ul class="list-group">
<li class="list-group-item">SWEETS</li>
<li class="list-group-item">SNACKS</li>
<li class="list-group-item">MISE</li>
<li class="list-group-item">REGIONAL</li>
<li class="list-group-item">BAKING</li>
</ul>
</div>
<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
Output

For more details visit the following link -
Question 23: How can you create Responsive Tables with Bootstrap?
Answer
In Bootstrap 3 we can create a responsive table by using .table-responsive class. The table will scroll horizontally on small devices (screen width under 768px). When viewing on larger than 768px wide, we will not see any difference in tables.
Example - Creating Responsive Table
In this example to make the table responsive we will place the table inside a <div> element and then we will apply the class .table-responsive on it by using the following code.












































Hamid KhanPosted Mar 2, 2021, 8:55 AM
Good explanation....................
Md Saud AlamPosted Oct 27, 2017, 6:56 AM
Understandable Article ...
Subhashkumar YadavPosted Dec 23, 2016, 12:09 AM
Nice Article ...........................
Khaja MoizuddinPosted Dec 22, 2016, 10:28 PM
Nice Article easy to understand for beginners
Prasanna MuraliPosted Jul 29, 2016, 11:48 AM
Nice one..
kalu singh raoPosted Jul 1, 2016, 9:26 PM
Nice...
Shaili DashoraPosted Jun 27, 2016, 5:01 AM
Nice creation.
Debasis SahaPosted Jun 27, 2016, 2:55 AM
Nice one..
Thiruppathi RPosted Jun 27, 2016, 2:04 AM
Great Book Of Bootstrap..
RajaPosted Jun 27, 2016, 12:29 AM
Nice Share..
Vignesh ManiPosted Jun 26, 2016, 4:36 PM
Good one
Muhammad Aqib ShehzadPosted Jun 26, 2016, 2:38 PM
Very nice and useful post
Neeraj PalPosted Jun 26, 2016, 11:38 AM
Nice post
Praveen KumarPosted Jun 26, 2016, 11:30 AM
Nice
Sourabh SomaniPosted Jun 26, 2016, 11:04 AM
Awesome sir :)
NitinPosted Jun 26, 2016, 7:56 AM
Good one
Guest UserPosted Jun 25, 2016, 11:37 PM
good one
Prasanna MuraliPosted Jun 25, 2016, 10:32 PM
Nice one....
kalu singh raoPosted Jun 25, 2016, 2:34 PM
Nice...