我在使用sans-serif字体时遇到标题问题。大多数字形不会“触摸”sans-serif字体中包含的div的左边界,字体越大越明显。因此标题似乎不符合以下常规文本。如何使任何无衬线字形“触摸”容器div的左边界?
这里是一个示例代码:
h1 {
font-family: sans-serif;
font-size: 72px;
font-weight: lighter;
}
.container {
border-left: 1px solid;
}
<div class="container">
<h1>F glyph</h1>
<h1>T glyph</h1>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</div>
http://jsfiddle.net/mishamsk/j73wwqa5/
有什么解决方法吗?
我不会坦白地打扰。一种选择是添加一些负面的“文本缩进”,但正如_F_和_T_字符之间的差异所示,这将取决于标题的文本。 – ckuijjer 2014-12-07 12:38:34
是的,好像是这样。我正在构建一个WordPress主题,因此无法预先了解标题文本。我很困惑,我没有注意到它在网络上;) – mishamsk 2014-12-07 17:46:54