teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

蛇足

2020/12/15 04:06

投稿

Lhankor_Mhy
Lhankor_Mhy

スコア37488

answer CHANGED
@@ -19,4 +19,24 @@
19
19
 
20
20
   
21
21
  > That means the Catamaran font uses 1100 + 540 units in a 1000 units em-square, which gives a height of 164px when setting font-size: 100px. This computed height defines the content-area of an element and I will refer to this terminology for the rest of the article. **You can think of the content-area as the area where the background property applies**
22
- [Deep dive CSS: font metrics, line-height and vertical-align - Vincent De Oliveira](https://iamvdo.me/en/blog/css-font-metrics-line-height-and-vertical-align)
22
+ [Deep dive CSS: font metrics, line-height and vertical-align - Vincent De Oliveira](https://iamvdo.me/en/blog/css-font-metrics-line-height-and-vertical-align)
23
+
24
+ # 蛇足
25
+
26
+ 上記記事にあった、この言葉を最後に書いておきますね。
27
+
28
+ > **It becomes obvious that setting line-height: 1 is a bad practice.** I remind you that unitless values are font-size relative, not content-area relative, and dealing with a virtual-area smaller than the content-area is the origin of many of our problems.
29
+ [Deep dive CSS: font metrics, line-height and vertical-align - Vincent De Oliveira](https://iamvdo.me/en/blog/css-font-metrics-line-height-and-vertical-align)
30
+
31
+ __line-height: 1 がバッドプラクティスであることは明らかです。__
32
+
33
+ ---
34
+
35
+ ちなみに、その後にこんなことも書いてあります。
36
+
37
+ > But not only line-height: 1. For what it’s worth, on the 1117 fonts installed on my computer (yes, I installed all fonts from Google Web Fonts), 1059 fonts, around 95%, have a computed line-height greater than 1. Their computed line-height goes from 0.618 to 3.378. You’ve read it well, 3.378!
38
+ [Deep dive CSS: font metrics, line-height and vertical-align - Vincent De Oliveira](https://iamvdo.me/en/blog/css-font-metrics-line-height-and-vertical-align)
39
+
40
+ __参考までに私がインストールした1117個のフォント(ええ、Googleフォントは全部インストールしてます)ですが、...... line-height は 0.618 から 3.378 でした。よろしいですか?3.378です!__
41
+
42
+ ええと、どうすれば?