css - html 自动调整文字间距
本文介绍了css - html 自动调整文字间距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
有没有一个css属性可以自动调整文字间距,比如
左侧红框的DIV宽度固定,有没有一个css属性可以让里面的文字自动调整间距,从而好看一些。
解决方案
你想要的是文字两端对齐.
.test1 {
text-align:justify;
text-justify:distribute-all-lines;/*ie6-8*/
text-align-last:justify;/* ie9*/
-moz-text-align-last:justify;/*ff*/
-webkit-text-align-last:justify;/*chrome 20+*/
}
@media screen and (-webkit-min-device-pixel-ratio:0){/* chrome*/
.test1:after{
content:".";
display: inline-block;
width:100%;
overflow:hidden;
height:0;
}
}
来源: http://www.cnblogs.com/rubylo...
这篇关于css - html 自动调整文字间距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文