css - 是否可以在 CSS 中使用 `text-decoration: underline;` 明确设置下划线文本的行高?

标签 css browser text-decorations

是否可以在 CSS 中使用 text-decoration: underline; 明确设置下划线文本的行高? IE 和 FireFox 使用 font-weight:bold;text-decoration: underline; 渲染文本,由于没有更好的词,应用为粗体或粗线。 Chrome、Safari 和 Opera 将其渲染为 1px。

目标是跨浏览器一致地呈现它(不,真的吗?继续!)。有什么建议吗?

最佳答案

最简单的事情就是用 <b> 包裹它元素并给它一个 bottom-border:1px solid;

这将确保 udnerline 在所有浏览器中均为 1 像素

关于css - 是否可以在 CSS 中使用 `text-decoration: underline;` 明确设置下划线文本的行高?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4484075/

相关文章:

javascript - Div 无法使用 angularjs 正确显示

delphi - 如何在 Delphi 应用程序中嵌入除 IE<n> 之外的浏览器对象

c# - WebBrowser - 查找呈现文本的高度

google-chrome - chrome 浏览器中 url 的最大长度

css - IE8 中链接上不需要的下划线

html - 文字装饰 : none not working at all

javascript - 使用移动设备访问时加载移动版本,否则加载桌面版本

html - 将 <img> 替换为 <div>

html - 我如何使用 flexbox 来实现具有垂直对齐列和斑马纹阴影的表格外观?

css - 文字装饰 : none does not work with Rails links