Internet Explorer中首字母缩略词和缩写词的默认值为
text-decoration: none;
。通过将此样式定义添加到css中,可以指定所需的样式(跨浏览器):
abbr[title], acronym[title] {
text-decoration: none;
border-bottom: 1px solid dotted;
}
编辑
您的特殊问题(当您更新答案时)不是缩写本身,而是您正在构建的flexbox网格。你只需要把
abbr
在一个容器中(例如,在我的例子中是一个div),所以
缩写
继承不会将其本身视为flex元素(正如其容器
display: flex;
。
div {
padding-right:2px;
}
.flex-row {
display:flex;
line-height:1;
width:100%;
margin-top:3px;
}
.flex-basis-9 {
flex-basis:9%;
}
label {
padding: 0;
}
.flex-basis-24 {
flex-basis:24.33%;
}
abbr[title] {
position: relative;
cursor: help;
text-decoration: none !important;
}
abbr[title]:before {
position: absolute;
left: 0;
top: 1em;
width: 100%;
content: '';
border-bottom: 1px dotted #000 !important;
}
a {
padding-right: 10px;
}
<div>
<div class="flex-row">
<div class="flex-basis-9">
<label>Field1</label>
</div>
<div class="flex-basis-24">Value1 </div>
<div class="flex-basis-9">
<label>Field2</label>
</div>
<a href="/some-url">dummy url</a>
<abbr title="StackOverflow" tooltipPosition="bottom">SO</abbr>
<div class="flex-basis-9"></div>
<div class="flex-basis-9">
<label>Field3</label>
</div>
<div class="flex-basis-24">Value3 </div>
</div>