Java, .NET, PHP, PYTHON, ANGULAR, .NET, ML, Data Scince, Testing, CI Tutorials in Easy Languages.

"Best Software Training, Internship, Project Development center of Indore India, Helpline 780506-3968"

What is Bootstrap?BootStrap Introduction, a Bootstrap tutorial for beginners 



Bootstrap is an external library that contains .css file and .js file to provide a responsive web layout. responsive means, Layout which is compatible with Mobile Screen, Desktop Screen, TV Screen, Tablet Screen, Projector, etc.

Bootstrap contain set of CSS block which will be called under HTML element. for example, if we want to create two different partitions which is compatible with all device.

How to use bootstrap:

1)first download bootstrap.min.js and bootstrap.min.css I have mentioned download link below with a complete example.

2) Create .html file and link bootstrap .css file and .js file

3) Write the following code to implement bootstrap

class="row" :-  it create responsive row

class="col":-  it create responsive columns


<div class="row">
<div class="col-sm-6">

</div>
<div class="col-sm-6">

</div>

</div>

Complete Code of bootstrap 

<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="bootstrap.min.css">

      <script src="bootstrap.min.js"></script>
      <link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div class="jumbotron text-center">
<h1>Welcome in SHIVA TUTORIALS</h1>

</div>
<div class="container">
<div class="row">
<div class="col-sm-4">
<h3>Column1</h3>
<p>JAVA</p>
<p>dfhgad fhgdhfgsdjhfgsdjhg fjsd gf djhfg dfdg fgdjh fgdjh fgjhad gfhdgfh gdfhgdjhgfdjhgfhadgjhfg djhfg djh fgdh gfhdgfhgdjh fgjhadfgadjh fgd gfhd gfdgjhfg adjh fgjhd gfdh gfhdgfh gdhf gadjh fgjhad gfhadgfhgadjhfg adjhfg adhg fhadg fhad gfhgadjhf gajhfgjha gfasgfh gdjhfgadjh fgasjhgfjhas gas gfjgas jh fgasjh gfasg hadg jhfgd hf gdjh fghd gfhd ghf gdjh fg</p>
</div>
<div class="col-sm-4">
<h3>Column2</h3>
<p>.NET</p>
<p>dfhgad fhgdhfgsdjhfgsdjhg fjsd gf djhfg dfdg fgdjh fgdjh fgjhad gfhdgfh gdfhgdjhgfdjhgfhadgjhfg djhfg djh fgdh gfhdgfhgdjh fgjhadfgadjh fgd gfhd gfdgjhfg adjh fgjhd gfdh gfhdgfh gdhf gadjh fgjhad gfhadgfhgadjhfg adjhfg adhg fhadg fhad gfhgadjhf gajhfgjha gfasgfh gdjhfgadjh fgasjhgfjhas gas gfjgas jh fgasjh gfasg hadg jhfgd hf gdjh fghd gfhd ghf gdjh fg</p>
</div>


<div class="col-sm-4">
<h3>Column3</h3>
<p>PHP</p>
<p>dfhgad fhgdhfgsdjhfgsdjhg fjsd gf djhfg dfdg fgdjh fgdjh fgjhad gfhdgfh gdfhgdjhgfdjhgfhadgjhfg djhfg djh fgdh gfhdgfhgdjh fgjhadfgadjh fgd gfhd gfdgjhfg adjh fgjhd gfdh gfhdgfh gdhf gadjh fgjhad gfhadgfhgadjhfg adjhfg adhg fhadg fhad gfhgadjhf gajhfgjha gfasgfh gdjhfgadjh fgasjhgfjhas gas gfjgas jh fgasjh gfasg hadg jhfgd hf gdjh fghd gfhd ghf gdjh fg</p>
</div>
</div></div>
<div class="jumbotron text-center">
<h1>footer</h1>

</div>
</body>
</html>





For more, you can go

https://github.com/shivaconceptsolution/htmldesign/tree/master/bootstrap


The Bootstrap 4 grid system has five classes:

.col- (extra small devices - screen width less than 576px)
.col-sm- (small devices - screen width equal to or greater than 576px)
.col-md- (medium devices - screen width equal to or greater than 768px)
.col-lg- (large devices - screen width equal to or greater than 992px)
.col-xl- (xlarge devices - screen width equal to or greater than 1200px)

we always prefer sm to define the column width.

<div class="col"></div>
<div class="col-sm-4"></div><div class="col-sm-8">


Text Colors in Bootstrap:-

Bootstrap 4 has some predefined classes that can be used to provide "meaning through colors".

The classes for text colors are: .text-muted, .text-primary, .text-success, .text-info, .text-warning, .text-danger, .text-secondary, .text-white, .text-dark, .text-body (default body color/often black) and .text-light:

<h1 class="text-primary">Why do we use it?</h1>

Background Colors
The classes for background colors are: .bg-primary, .bg-success, .bg-info, .bg-warning, .bg-danger, .bg-secondary, .bg-dark and .bg-light.

<div class="bg-warning"></div> 

when we want to apply more than one class in a single div tag or any HTML  tag.

<div class="col-sm-3 bg-danger text-primary">

............................................................................................................................................................

What is Flex:-

It is special box layout of bootstrap4 which is used to design layout without using the float property.


it provide d-flex class to create a flex layout.

Row-wise:-

<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="bootstrap.min.css" />
<script type="text/javascript" src="bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div class="d-flex flex-column p-3">

<div class="p-2 bg-primary">JAVA</div><div class="p-2 bg-secondary">PYTHON</div><div class="p-2 bg-info">PHP</div></div>

</div>
</body>
</html>

Column-wise flex layout:-

<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="bootstrap.min.css" />
<script type="text/javascript" src="bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div class="d-flex flex-column p-3">

<div class="p-2 bg-primary">JAVA</div><div class="p-2 bg-secondary">PYTHON</div><div class="p-2 bg-info">PHP</div></div>

</div>
</body>
</html>

...............................................................................................................................................

Create a menu using the toggler:-

Bootstrap provide class="navbar" and floowing atrribute

<nav class="navbar navbar-expand-md bg-dark navbar-dark">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
    <span class="navbar-toggler-icon"></span>
  </button>


<div class="collapse navbar-collapse" id="collapsibleNavbar">
    <ul class="navbar-nav">
      <li class="nav-item">
        <a class="nav-link" href="#">Link</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="#">Link</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="#">Link</a>
      </li>
    </ul>
  </div>
</nav>


......................................................................................

The sequence of BootStrap Plugin:-

1) <meta name="viewport" content="width=device-width, initial-scale=1">


2)  bootstrap.min.css


3)   jquery.min.js


4)   popper.min.js


5)  bootstrap.min.js


We always use the offline files.



How to create a slider in bootstrap:-

to create slider we will use carousal property under div.

Complete code to design slider.


<!DOCTYPE html>
<html>
<head>
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="bootstrap.min.css">
  <script src="jquery.min.js"></script>
  <script src="popper.min.js"></script>
  <script src="bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>

<div id="demo" class="carousel slide bg-danger" data-ride="carousel">

  <!-- Indicators -->
  <ul class="carousel-indicators">
    <li data-target="#demo" data-slide-to="0" class="active"></li>
    <li data-target="#demo" data-slide-to="1"></li>
    <li data-target="#demo" data-slide-to="2"></li>
  </ul>

  <!-- The slideshow -->
  <div class="carousel-inner">
    <div class="carousel-item active">
      <img src="1.jpg"  width="800" height="400" alt="Los Angeles">
      <div class="carousel-caption">
    <h3>Los Angeles</h3>
    <p>We had such a great time in LA!</p>
  </div>
    </div>
    <div class="carousel-item">
      <img src="2.png"  width="800" height="400" alt="Chicago">
      <div class="carousel-caption">
    <h3>Los Angeles</h3>
    <p>We had such a great time in LA!</p>
  </div>
    </div>
    <div class="carousel-item">
      <img src="3.jpg" width="800" height="400" alt="New York">
      <div class="carousel-caption">
    <h3>Los Angeles</h3>
    <p>We had such a great time in LA!</p>
  </div>
    </div>
  </div>

  <!-- Left and right controls -->
  <a class="carousel-control-prev" href="#demo" data-slide="prev">
    <span class="carousel-control-prev-icon"></span>
  </a>
  <a class="carousel-control-next" href="#demo" data-slide="next">
    <span class="carousel-control-next-icon"></span>
  </a>

</div>


</body>
</html>






Post a Comment

If you have any doubt in programming or join online classes then you can contact us by comment .

Previous Post Next Post