我喜欢听话的前端开发人员必须创建带有 2 像素填充的下划线,而不是默认的 1 像素。是否存在简单的解决方案?
PS 是的,伙计们,我知道 div 具有黑色背景颜色和 1px * Npx 和位置:相对,但它太慢了......
对于交叉浏览,最好使用text-underline-offset
超过text-underline-position
, 因为text-underline-position
不支持iOS 浏览器 https://developer.mozilla.org/en-US/docs/Web/CSS/text-underline-position#browser_compatibility
所以使用这个答案:https://stackoverflow.com/a/63607426/1894907 https://stackoverflow.com/a/63607426/1894907
#line{
text-decoration-line: underline;
text-underline-offset: 2px;
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)