我如何在Safari浏览器中应用CSS来显示背景颜色和悬停效果。

发布于 2025-01-22 13:59:10 字数 1352 浏览 4 评论 0原文

我无法弄清楚如何使用Safari浏览器解决此问题。注意所附的图像。一个镀铬,带有背景颜色的盒子,还有一个悬停效果,可行。 (也在FF和IE中工作),Safari没有任何作用。没有悬停,背景只是白色,所以您看不到文字。这是该框的代码。我正在使用Safari版本的Chrome Dev工具来测试不同的CSS,但是我无法在包装盒中找到该背景进行更改,也无法悬停。关于如何攻击此问题的任何建议将不胜感激。

<ul>
<li class="acet-sum-item--clear"><a href="/applies/apples-tie-back-comments">
“Clear Filters”
::after
</a>
</li>

    .acet-sum-item--clear a {  
color: #fff;
    display: inline-block;
    text-align: center;
    border-radius: .15rem;
    background-color: #999;
    font-size: .65rem;
    padding: 0 1.5em;
    line-height: 1.3rem;
    font-weight: 400;
    border: none;
    margin: 0 .4rem 1rem .5rem;
    -webkit-appearance: button;
    cursor: pointer;
    margin-left: 0;
}

.acet-sum-item--clear a:hover    {
cursor: pointer;
    color: #fff;
    background-color: #20558a;
    text-decoration: none;
    border: none;
}

”在此处输入图像描述”

i can not figure out how to address this issue with safari browser. Note the images attached. One Chrome, shows box with background color and there is also a hover effect, that works. (works in FF and IE as well), Nothing works in Safari. no hover, background just white, so you can't see the text. Here is the code of that box. I am using safari's version of chrome dev tools to test different css, but I can't get that background within the box to change and no hover is working. Any suggestions on how to attack this problem would be greatly appreciated.

<ul>
<li class="acet-sum-item--clear"><a href="/applies/apples-tie-back-comments">
“Clear Filters”
::after
</a>
</li>

    .acet-sum-item--clear a {  
color: #fff;
    display: inline-block;
    text-align: center;
    border-radius: .15rem;
    background-color: #999;
    font-size: .65rem;
    padding: 0 1.5em;
    line-height: 1.3rem;
    font-weight: 400;
    border: none;
    margin: 0 .4rem 1rem .5rem;
    -webkit-appearance: button;
    cursor: pointer;
    margin-left: 0;
}

.acet-sum-item--clear a:hover    {
cursor: pointer;
    color: #fff;
    background-color: #20558a;
    text-decoration: none;
    border: none;
}

Screenshot from Chrome vs Safari

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦幻之岛 2025-01-29 13:59:10

这最终是一个 - 网络问题。它设置为某个东西 - 不记得了什么,但是我添加了定位Safari的代码,然后将其设置为无。中提琴 - 颜色和悬停效应工作。

This ended up being a -webkit issue. It was set to something - can't remember what, but I added code targeting safari and then set it to none. viola - the color and hover effect work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文