html - 如何垂直对齐字形?

标签 html css alignment glyph

我需要字形与文本垂直对齐。现在它看起来更像是固定在底部的。

这里作为例子

<a href="#">Zoom</a>

a {
    font-family: 'Open Sans', sans-serif;
    font-weight: 600;
    font-size: 32px;
    color: #333;
    text-decoration: none;
    text-transform: uppercase;
}

a:before { content:"\2039"; }

和一个jsFiddle

最佳答案

仅使用垂直对齐和固定偏移量最容易做到这一点。例如

a:before { content:"\2039"; vertical-align:0.1em; }

a {
    font-family: 'Open Sans', sans-serif;
    font-weight: 600;
    font-size: 32px;
    color: #333;
    text-decoration: none;
    text-transform: uppercase;
}

a:before { content:"\2039"; vertical-align:0.1em; }
<a href="#">Zoom</a>

参见http://jsfiddle.net/csh0da6o/3/

关于html - 如何垂直对齐字形?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27092074/

相关文章:

image - 带有图像的 tableviewer 中的奇怪对齐和布局

css div定位

css - 段落在 div 之外流动

javascript - 如何附加 <asp :Button/> etc. .在 <form> 标签内使用 javascript?

javascript - 我正在尝试计算一组函数的小计,但没有输出 :

html - 如何找到 :visited styles in firebug/FF Dev Tools

javascript - 单击按钮时的 JQuery,向下滚动并使用 Waypoints 动画图形

html - 在多个图像上居中文本

JavaScript 和 HTML : in two separate files or in a single HTML file?

html - jsfiddle 中的奇怪边距