CSS行高指南 [英] CSS Line-Height Guide
问题描述
我记得阅读一个样式指南,解释每个元素应该有正确的行高。我不能在Google上找到它。
如果任何人可以将我链接到这样的指南,或者在解答中解释它,我将感激。
谢谢!
编辑:SORRY,请让我澄清。我不是问如何使用CSS来设置行高,但推荐的行高是为各种元素。
谢谢!
也许这些参考更像是你正在寻找。我没有找到一个确定的规则,但至少这里有一些事情要考虑。这个建议,这取决于你选择的font-family:
http://www.webteacher.ws / 2009/09/30 / improve-readability-with-line-height /
这个建议取决于行的宽度:
http://kingdesk.com/articles/optimal-line-height/
此引用基本上与以下两者兼容:
http://www.wpdesigner.com/2007/06/21/web-typography-line-spacing/
主要规则似乎是(1)更宽的文本行需要更大的行高,以及(2)如果小写字母的高度基于字体,则需要更大的行高是大写字母高度的高百分比。
最好的方法可能只是眼球,并尽量避免文本的不可渗透的墙。
I remember reading a style guide explaining what the proper line-height should be for each element. I can't find it on google.
I would appreciate it if anyone could link me to such a guide, or perhaps explain it in an answer.
Thanks!
Edit: SORRY, please let me clarify. I'm not asking about how to use CSS to set line-heights, but what the recommended line-heights are for various elements. eg headers, paragraph text, etc.
Thanks!
Maybe these references are more like what you're looking for. I haven't found a definitive rule, but at least here are some things to consider.
This one suggests that it depends on your choice of font-family: http://www.webteacher.ws/2009/09/30/improve-readability-with-line-height/
This one suggests that it depends on the width of the lines: http://kingdesk.com/articles/optimal-line-height/
This reference essentially agrees with both of those: http://www.wpdesigner.com/2007/06/21/web-typography-line-spacing/
The main rules seem to be (1) wider lines of text require greater line-heights, and (2) greater line-height is required based on font if the height of lower-case letters is a high percentage of the height of upper-case letters.
The best approach is probably just to eyeball it, and try to avoid impenetrable walls of text.
这篇关于CSS行高指南的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!