如何删除顶部/底部的空白空间? [英] How to remove empty space in top/bottom of span?

查看:145
本文介绍了如何删除顶部/底部的空白空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是 jsfiddle 。我想删除文本中顶部和底部的空白。我试图使用行高,但它不是我需要的。我怎么能做到呢?感谢。

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

解决方案

这不太理想, code> height 和 line-height 来实现:



div class =snippetdata-lang =jsdata-hide =false>

  @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&文本< / span>  


This is jsfiddle. I want to remove empty space in top and bottom in my text. I tried to use line-height, but its not what I need. How I can do it? Thanks.

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

解决方案

This is not ideal, however you could play with height and line-height to achieve that:

@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>

这篇关于如何删除顶部/底部的空白空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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