Right Align Text in Bootstrap framework


We have text aligned left by default. If you are using Twitter's Bootstrap Framework and want to align text right then you must make use of class="text-right" in the element that contains the text.

text aligned right
text aligned right

Let's have a look at an example :

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap : Text Align Right</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</head>
<body>
  
<div class="container">
<p class="text-right" style="padding:20px">Text aligned right</p>       
</div>

</body>
</html>
Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap