我应该避免使用“text-align:justify;”? [英] Should I avoid using "text-align: justify;"?

查看:232
本文介绍了我应该避免使用“text-align:justify;”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有任何理由避免使用 text-align:justify;

Is there any reason to avoid using text-align: justify;?

是否会降低可读性或导致问题?

Does it reduce readability or cause problems?

推荐答案

这纯粹是一个与设计相关的问题和解决方案。网格的设计指定是否需要调整文本。我认为对齐单独对可用性没有重大影响。使字体难以辨认的坏排版使可用性降低。也就是说,确保你有坚实的对比度和你的类型中的间距的良好平衡。字体大小也很重要。

Firstly, this is purely a design-related problem and solution. The design of your grid specifies if justifying text is needed. I think justify align alone has no major effect on usability. Bad typography that makes text illegible is what decreases usability. That said, make sure you have solid contrasts and a good balance of spacing in your type. Font-size matters too.

此网站是成功尝试在线证明文本。由于你不能像使用InDesign那样用CSS来控制字母和单词之间的空格,因此很难证明文本有效,而且没有空格的河流沿着你的行运行,这发生在单词之间的空格超过线之间的间距。使文本难以理解的事情:长字,行宽不足够的单词,以及文本和背景颜色之间太多的对比度;

This site is a successful attempt at justifying text online. Since you can't control the spaces between letters and words nearly as much with CSS as you can with InDesign, it's a lot harder to justify text and not have 'rivers' of whitespace run down your rows, which happens when the spaces between words exceeds the spaces between lines. Things that make justifying text difficult: long words, row widths that don't hold enough words, and too much contrast between the text and the background colors; they make the rivers appear wider and more apparent.

排版的理想是有一个平均的文本块,其中如果你使文本块变成一个统一的固体阴影。因此,如果你在白色背景上保持文本大约10px和60%灰色,并且有20个字的行,对齐不应该看起来丑陋。但请记住,这不会提高可用性。小的,相对较轻的文本恼人了很多人,特别是老读者。

The typographic ideal is to have an even text-block, where if you squint the text block becomes a uniform solid shade. So if you keep text at about 10px and 60% gray on white background, and have rows that fit about 20 words, justify align shouldn't look ugly. But keep in mind this does nothing to improve usability. Small, relatively light text annoys a lot of people, especially the older readers.

我应该注意到,使用& shy; (软连字符)正确地分隔了很多麻烦的词,比如超级&害羞;真棒您可以模仿正确的排版(例如InDesign)。有很多东西在那里,以帮助你这样做。我会推荐隐藏,操作和显示要在客户端执行的文本的逻辑,可能使用

I should note that with ­ (soft hyphenation) correctly separating long troublesome words like super­awesome you can mimic proper typesetting (e.g. InDesign). There's a lot of stuff out there to help you do this. I would recommend the logic for hiding, manipulating, and displaying the text to be done on the client side, perhaps with this.

编辑:正如别人在下面提到的, css hyphens 现在可能,但不可行(不是在Chrome)。此外, css4提供更多的控制

Edit: As others mention below, css hyphens are possible now, except not feasible (not in Chrome). Plus, css4 offers even more control.

这篇关于我应该避免使用“text-align:justify;”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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