【发布时间】:2021-07-05 16:22:46
【问题描述】:
我有一个问题,在 :hover 我的标签应该带有红色下划线,但这似乎不会在 Safari 浏览器上发生。
这是它在 Chrome 浏览器上的显示方式,但在 Safari 上它不会呈现红色下划线。
HTML代码
<div class="container bot-category">
<div class="row text-center my-5">
<div class="col">
<a class="btn btn-outline-success btn-floating m-1" href="{% url 'bots' %}" role="button" >View all</a>
</div>
<div class="col">
<a class="btn btn-outline-dark btn-floating m-1" href="{% url 'support' %}" role="button">Read FAQs</a>
</div>
<div class="col">
<a class="btn btn-outline-dark btn-floating m-1" href="" role="button">Botbrary</a>
</div>
<div class="col">
<a class="btn btn-outline-dark btn-floating m-1" href="{% url 'bots' %}" role="button">Scripts</a>
</div>
</div>
</div>
CSS 代码
.bot-category a:hover{
background-color: black !important;
text-decoration: underline 2px solid #f4364c !important;
color: white !important;
-webkit-decoration: underline 2px solid #f4364c !important;
}
【问题讨论】:
-
你能添加一些代码吗?所有浏览器都支持
text-decoration属性。 developer.mozilla.org/en-US/docs/Web/CSS/text-decoration -
你可以试试
-webkit-text-decoration-line: underline;w3schools.com/cssref/… -
我试过了,它在 Safari 和 Chrome 上都不起作用
标签: html css twitter-bootstrap frontend