文本对齐——俩端对齐

众所周知比较常见的css文本对齐方式是,居中对齐,左对齐,右对齐,而这三种方式能解决大多数的文本对齐,今天我为大家带来比较少见的两段对齐。
3.效果如下图:

两端对齐.png

1.HTML代码:

<div class="justify">

<div class="li">第一</div>

<div class="li">第二</div>

<div class="li">第三有点</div>

</div>

2.css代码:

.justify{

padding: 0 20px;

margin-top: 10px;

width: 100px;

background-color: #00FF33;

line-height: 40px;

text-align-last: justify;/* 两端对齐 */

color: #0000FF;

list-style: none;
}

还有其他的方法欢迎大家留言补充。

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。