CSS文本对齐调整大空格 [英] CSS text align justify big spaces

查看:121
本文介绍了CSS文本对齐调整大空格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要格式化段落我使用 text-align:justify ,但我有一个问题,在词之间有大的空格,对于IE的解决方案是使用 text-justify:distribute; ,但Chrome不支持此功能,我的问题是我应该为Chrome和Firefox使用



大空格示例: http://jsfiddle.net/L5drN/

解决方案

考虑使用连字符(手动,CSS,服务器端或客户端JavaScript),参见例如我可以使用CSS来在文本末尾添加连字符的单词来证明文本吗?
当文本中有长单词时,连字会帮助很多。



您仍然可以保留 text-justify:distribute ,因为它可以改善支持浏览器的结果,并且可以预期获得支持,因为它在CSS标准化轨道(在 CSS Text Module Level 3 WD)中。 p>

To format paragraphs I use text-align:justify, but I have one problem that there are big spaces between words, for IE the solution is to use text-justify: distribute;, but Chrome doesn't support this, my question is what should I use for Chrome and Firefox

Example of big spaces: http://jsfiddle.net/L5drN/

解决方案

Consider using hyphenation (manual, CSS, server-side, or client-side JavaScript), see e.g. answers to Can I use CSS to justify text with hyphenating words at the end of a line? Hyphenation tends to help a lot when there are long words in the text.

You can still keep text-justify: distribute, as it can improve the result on supporting browsers, and it can be expected to gain support, as it in the CSS standardization track (in CSS Text Module Level 3 WD).

这篇关于CSS文本对齐调整大空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆