第二章 排版 2.8文本对齐风格

在排版中离不开文本的对齐方式。在CSS中常常使用text-align来实现文本的对齐风格的设置。其中主要有四种风格:

☑ 左对齐,取值left

☑ 居中对齐,取值center

☑ 右对齐,取值right

☑ 两端对齐,取值justify

为了简化操作,方便使用,Bootstrap通过定义四个类名来控制文本的对齐风格:

☑ .text-left:左对齐

☑ .text-center:居中对齐

☑ .text-right:右对齐

☑ .text-justify:两端对齐

具体源码查看bootstrap.css文件第488行~第499行:

.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
.text-center {
text-align: center;
}
.text-justify {
text-align: justify;
}

 

posted @ 2018-12-09 14:16  楠木v  阅读(117)  评论(0编辑  收藏  举报