The alignment of text is inseparable from typography. Text-align is often used in CSS to achieve text alignment style settings. There are four main styles:
☑ Align left, value left
☑ Center alignment, value center
☑ Right alignment, value right
☑ Both ends are aligned, the value is justify
In order to simplify the operation and facilitate use, Bootstrap controls the alignment style of the text by defining four class names:
☑ .text-left: left alignment
☑ .text-center: center alignment
☑ .text-right: Align right
☑ .text-justify: justify both ends
For the specific source code, check the bootstrap.css file from line 488 to line 499:
.text-left { text-align: left; } .text-right { text-align: right; } .text-center { text-align: center; } .text-justify { text-align: justify; }