如何使文本装饰:2px填充下划线? [英] How make text-decoration: underline with 2px padding?

查看:60
本文介绍了如何使文本装饰:2px填充下划线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢听话的老手开发人员必须使用2px填充而不是默认情况下的1px创建下划线。是存在简单的解决方案吗?

I like an obedient frotend developer must create underline with 2px padding instead of 1px by default. Is exist simple solution for this?

PS是的,我知道div具有黑色背景色和1px * Npx和位置:相对,但是它是如此缓慢...

PS Yeahh guys, I know about div with black backgrond color and 1px * Npx and position: relative, but It's so slowly...

推荐答案

您可以将文本包装在 span 中并给它一个边框底部 padding-bottom:2px;

You could wrap the text in a span and give it a border-bottom with padding-bottom:2px;.

像这样

span{
    display:inline-block;
    border-bottom:1px solid black;
    padding-bottom:2px;
}

示例:http://jsfiddle.net/uSMGU/

这篇关于如何使文本装饰:2px填充下划线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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