[英]how to remove white space in justified css
When you are using text-align: justify
, you are asking browsers to add spacing, and browsers implement this as added spacing between words. 当您使用
text-align: justify
,您要求浏览器添加间距,并且浏览器将其实现为单词之间的间距。 According to CSS Text Module Level 3 LC, you could additionally use text-justify: distribute
to ask browsers to use added spacing both between words and between characters in words, to achieve a more balanced result, but it is debatable whether the results are really better, and this feature has been implemented only in IE (long ago). 根据CSS Text Module Level 3 LC,您还可以使用
text-justify: distribute
来要求浏览器在单词之间和单词之间使用添加的间距来实现更平衡的结果,但结果是否真的存在争议更好,此功能仅在IE(很久以前)中实现。
What you can do to improve the situation is to use hyphenation. 你可以做些什么来改善这种情况就是使用连字法。 This generally reduces the need for added spacing, though of course it cannot remove it.
这通常减少了增加间距的需要,但当然它不能将其移除。 The most effective way is to use Hyphenator.js , which means that you need to declare the language of your page, eg
<html lang=en>
, to set the hyphenate
class on any elements where text should be hyphenated, eg with <body class=hyphenate>
to hyphenate everything, and to just add the code 最有效的方法是使用Hyphenator.js ,这意味着您需要声明页面的语言,例如
<html lang=en>
,在文本应该连字符的任何元素上设置hyphenate
类,例如<body class=hyphenate>
连接所有内容,并只添加代码
<script src=http://hyphenator.googlecode.com/svn/tags/Version%204.2.0/Hyphenator.js></script>
<script>Hyphenator.run();</script>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.