使用 letter-space 后文字不能居中解决

1 letter-space:2em;
2 text-align: center;

 

使用letter-space后和上面的字体对比明显没有居中;

选定元素后发现,每个字后面都被加了2em,不是不能居中而是因为多了最后一个字的2em,所以向左多对齐了2em。

解决办法:

1 letter-space:2em;
2 text-align: center;
3 
4 text-indent: 2em;/*使用首行缩进,缩进2em,正好抵消之前多的2em*/

 

如果觉得过于冗余,还是建议在字符之间 加" "吧

 

posted @ 2017-02-21 10:46  objectBao  阅读(1629)  评论(0编辑  收藏  举报