Articles → BOOTSTRAP → Text Alignment In Bootstrap
Text Alignment In Bootstrap
Purpose
- text-left - to make text left-aligned.
- text-right - to make text right-aligned.
- text-center - to make text center-aligned.
- text-justify - to make the text justified.
- text-nowrap - Text will not wrap if length of the text is greater than the width of the webpage.
Example
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.css">
</head>
<body>
<div class="container">
<p class="text-left">Left-aligned text.</p>
<p class="text-right">Right-aligned text.</p>
<p class="text-center">Center-aligned text.</p>
<p class="text-justify">Welcome to Gyan Sangrah: A one stop shop for people preparing for technical interviews. Gyansangrah is an online resource comprising all the possible questions you may face during your technical interview round. Gyansangrah also provides you with live examples to make concepts easier to understand.</p>
<p class="text-nowrap">Welcome to Gyan Sangrah: A one stop shop for people preparing for technical interviews. Gyansangrah is an online resource comprising all the possible questions you may face during your technical interview round. Gyansangrah also provides you with live examples to make concepts easier to understand.</p>
</div>
</body>
</html>
Output
Click to Enlarge