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>





Recent Posts:
Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and Software Developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include Learnings, Video Tutorials, Code Snippets, How Tos, Blogs, Articles, etc.