为什么浏览器保留空间用于ACCENTED CHARACTERS,即使没有一个? [英] why browsers reserve space for ACCENTED CHARACTERS even if there is not one?

查看:162
本文介绍了为什么浏览器保留空间用于ACCENTED CHARACTERS,即使没有一个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

参考:

我的问题是关于此问题中社区成员提供的说明如何删除< p>顶部的空格标记/对齐包含文本到容器顶部?


问题

我想知道的是,假设我的 < p> 或任何其他标记不包含任何此类字符,如ÄĈ那么为什么浏览器会为它保留一个空间(它保留一个空格.... ??因为我不知道,m只是在引用的问题解释)....

浏览器渲染标记和CSS中给出的内容。如果代码中没有重音符号,为什么是空格,然后?

What i want to know is, that,assuming my <p> or any-other markup doesn't contain any such characters, like Ä or Ĉ then why would browser reserve a space for it (does it reserves a space....?? since i don't know, m just going in line of explanation in the quoted question)....

browsers render what has been given in the markup and the CSS....if there is no accented character in the code, why is a space there for it then??

推荐答案

这完全取决于字体。请参阅相关示例的屏幕截图:

This is entirely up to the font. See the screenshot of the example in question:

突出显示的Lorem的行高与包含元素(浅蓝色)完全齐平。这封信根本没有伸展到最大可用高度,只是没有伸展到基线以下。

The line height of the highlighted "Lorem" is perfectly flush with the containing element (light blue). The letter simply doesn't stretch all the way up to the maximum available height, just the same as it doesn't stretch all the way down below the baseline.

< img src =https://i.stack.imgur.com/2vEGU.pngalt =L>

这取决于字体的创建者以在字母之上或之下留出空间,这通常是为了保持包括可能更高的字母的字体的整体视觉平衡而进行的。例如:

It is up to the creator of a font to leave space above or below a letter, which is typically done to preserve the overall visual balance of the font face which includes letters which may be taller. See for example:



如果A将一直延伸到最大可用高度,则它旁边的Ä要么高于高度,要么被压扁。因为这看起来很糟糕,常规的A没有那么高,因此A可以在视觉上相同。

If the "A" would be stretching all the way to the maximum available height, the "Ä" next to it would either be taller than tall or would need to be squished down. Since this looks crappy, the regular "A" is not as tall as it possibly could be so both "A" can be the same visually.

无论你实际上是否使用重音字母,字形不会根据内容动态重新缩放。它们总是相同的高度,由字体创建者设置。如果您有这个文字块,该怎么办?

It has nothing to do with whether you're actually using accented letters or not, glyphs are not rescaled dynamically based on content. They're always the same height, which is set by the font creator. What if you had this block of text:


AAAAAAAAAAAAAAAAAAAÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ

ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄCAAAAAAAAAAAAAAAAAAAAA

AAAAAAAAAAAAAAAAAAA ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ

ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄAAAAAAAAAAAAAAAAAAA

AAAAAAAAAAAAAAAAAAA ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ AAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAA ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ AAAAAAAAAAAAAAAAAAA

如果信件大小会根据您是否需要额外的空间不是,这将给出非常不均匀的外观。这就是为什么它没有做。

If the letter size would dynamically change based on whether you "need extra space" or not, this would give an extremely uneven appearance. Which is why it's not being done.

这篇关于为什么浏览器保留空间用于ACCENTED CHARACTERS,即使没有一个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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