简体   繁体   English

CSS过渡效果::文本更改颜色,但不更改边框

[英]CSS Transition Effect :: Text changing color, but not border

I'm trying to apply a transition effect to some icons. 我正在尝试将过渡效果应用于某些图标。 The transition works for the font (FontAwesome), but not for the border, and I'm not sure why. 过渡适用于字体(FontAwesome),但不适用于边框,我不确定为什么。 Been trying since yesterday, combed through the web including stackoverflow, but nothing. 从昨天开始一直在尝试,通过网络进行了梳理,包括stackoverflow,但没有任何结果。

You can see the example here , and here is the code: 您可以在此处看到示例,这里是代码:

.social-nets-wrapper .social li a {color: rgb(53, 61, 68); font-size: 35px; border-color: #272F37;}

.social-nets-wrapper .social li a::before {background-color: #272f37;}

.social-nets-wrapper .social li a:hover {color: #f7941e; border-color: #f7941e; transition: all 300ms linear 0s;}

Any suggestions are greatly appreciated. 任何建议,不胜感激。

You have set in some place of your CSS: 您已经在CSS的某个位置进行了设置:

.social-nets-wrapper .social li a:hover {
    text-decoration: none;
    border-color: #FFF !important;
}

Then, you need to put: 然后,您需要输入:

.social-nets-wrapper .social li a:hover {
    color: #F7941E;
    border-color: #F7941E !important; /* add !important to override */
    transition: all 300ms linear 0s;
}

Or better, find the wrong declaration an fix it with the right one. 或者更好的方法是,找到错误的声明并使用正确的声明对其进行修复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM