html - 如何删除跨度顶部/底部的空白区域?

标签 html css

<分区>

这是 jsfiddle .我想删除文本顶部和底部的空白区域。我尝试使用行高,但这不是我需要的。我该怎么做?谢谢。

span {
    font-size: 24px;
    font-weight: 600;
    font-family: 'Roboto';
}

enter image description here

最佳答案

这并不理想,但是您可以使用 heightline-height 来实现:

@import url(http://fonts.googleapis.com/css?family=Roboto:300,400,500,700);
span {
    font-size: 50px;
    font-weight: 600;
    font-family: 'Roboto';

    display: inline-block;
    vertical-align: top;
    height: .75em;
    line-height: .75em;

    background-color: gold;
}
<span>Some Text</span>

关于html - 如何删除跨度顶部/底部的空白区域?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26440174/

相关文章:

jquery - 显示所有选择的文件

php - 在联系表 7 上隐藏验证错误或成功消息框

html - 选择类 :first-of-type for same html child tag

html - 排在附属类(class)的第一个 child ?

html - 如何在 HTML 选择列表 <option></option> 中显示多个空格

html - 三 Angular 形 block 未拉伸(stretch)全宽

list - 无法添加指向整个 div 部分的链接

javascript - 消除加载 javascript/css 时的页面闪烁

html - 如何在移动版本中编辑文本的 css margin-top

html - 使用 Canvas 和 svg 导出或捕获 div