Pull Right Bootstrap
Posted by Superadmin on April 30 2023 16:58:16

Pull Right Bootstrap

Pull Right Bootstrap

Introduction to Pull Right Bootstrap

The pull right is the utility class in bootstrap used to place the information right side of the display screen. The pull-right class is utilized to keep the content or element right side of the grid system in the bootstrap. The pull right utility class is used to float the element on the right side of the web application screen. The pull-right class is used up to bootstrap3, after bootstrap 4 it is replaced with float-right.

Syntax:

<div class ="pull-right">
This div placed to the right side of the screen device.
</div>

How does Bootstrap Pull Right work?

Below are the different steps for working of Pull Right:

Step 1:

Step 2:

<link rel = "stylesheet" href = "https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js">
</script>
<script src = "https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js">
</script>

Step 3:

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

Step 4:

<div class ="pull-right">
This div placed to the right side of screen device.
</div>
<!DOCTYPE html>
<html>
<head>
<title>  Bootstrap pull-right class 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.4.1/css/bootstrap.min.css">
<script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js">    </script>
<script src = "https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js">   </script>
</head>
<body>
<div class = "pull-right">
This div placed to the right side of screen device.
</div>
</body>
</html>

Examples

Below are the different examples of Pull Right:

Example #1

The basic pull-right class in the example and output are below.

<!DOCTYPE html>
<html>
<head>
<title> Bootstrap pull-right class 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.4.1/css/bootstrap.min.css">
<script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js">
</script>
<script src = "https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js">   </script>
</head>
<body>
<h3> Bootstrap pull-right class </h3>
<div class = "container">
This div placed to the default position of screen device.
</div> <br>
<div class = "container pull-right">
<b> This div placed to the right side of screen device. </b>
</div> <br> <br>
<div class = "container">
This div placed to the default position of screen device.
</div>
</body>
</html>

Output:

Pull Right Bootstrap Example 1

Description:

Example #2

The responsive pull-right bootstrap example and output are below.

<!DOCTYPE html>
<html>
<head>
<title> Bootstrap pull-right class Example </title>
<meta name = "viewport" content = "width = device-width, initial-scale =1">
<link rel = "stylesheet" href = "https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js">
</script>
<script src = "https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js">   </script>
<style>
.container-fluid {
width: 200px;
height:100px;
background-color: yellow;
}
.container {
width: 200px;
height: 100px;
background-color: orange;
}
</style>
</head>
<body>
<center>
<h3> Bootstrap pull-right class </h3>
</center>
<div class = "container ">
<p>This div placed to the default position of screen device. </p>
</div> <br> <br>
<div class = "container-fluid pull-right">
<b> this div placed to the right side of screen device. </b>
</div>
</body>
</html>

Output 1:

Pull Right Bootstrap Example 2.1

Output 2:

Pull Right Bootstrap Example 2.2

Description:

Example #3

The pull-right class with bootstrap table example and output is below.

<!DOCTYPE html>
<html>
<head>
<title> Bootstrap pull-right class Example </title>
<meta name = "viewport" content = "width = device-width, initial-scale=1">
<link rel = "stylesheet" href = "https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js">
</script>
<script src = "https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js">
</script>
<style>
.pull-right {
background-color: orange;
}
</style>
</head>
<body>
<div class = "container">
<h2> Bootstrap pull-right class with Table </h2>
<table class = "table table-bordered">
<thead>
<tr>
<th> Name </th>
<th> Mobile </th>
<th> city </th>
</tr>
</thead>
<tbody>
<tr>
<td> Aman </td>
<td class = "pull-right"> 7765757577 </td>
<td> man@gmail.com </td>
</tr>
<tr>
<td> Radha </td>
<td class = "pull-right"> 9567543212 </td>
<td > radham@yahoo.com </td>
</tr>
</tbody>
</table>
</div>
</body>
</html>

Output:

Example 3

Description:

Example #4

The basic pull-right class with button example and output is below.

<!DOCTYPE html>
<html>
<head>
<title>  Bootstrap pull-right class 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.4.1/css/bootstrap.min.css">
<script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js">    </script>
<script src = "https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js">   </script>
</head>
<body>
<h3> Bootstrap pull-right class </h3>
<button type= "button" class= "btn btn-success"> login </button>
<br>
<button type= "button" class= "btn btn-danger pull-right"> cancel </button>
<br>
<button type= "button" class= "btn btn-info"> register </button>
<br>
<button type= "button" class= "btn btn-warning pull-right"> submit </button>
<br>
</body>
</html>

Output:

Example 4

Description:

Conclusion