1
Guys, I have a problem in the transition
CSS3, I have an icon in Font Awesome and link text that changes from white to light green on :hover
, but when taking out the mouse the color changes one in the sequence of the other, instead of changing together.
Situation:
My code is arranged as follows:
@import url('https://fonts.googleapis.com/css?family=Oswald:200,300,400,500,600,700');
html * {
box-sizing: inherit;
font-size: 16px;
transition: color 0.5s ease;
}
body {
line-height: inherit;
font-family: 'Oswald', 'sans-serif';
font-size: inherit;
max-width: 100%;
padding: 0;
color: #828282;
background: #fff;
}
.header-top-menu {
height: 40px;
background-color: #393738;
max-width: 100%;
vertical-align: center;
}
.header-top-menu ul {
margin: 0;
padding: 0;
list-style: none;
}
.header-top-menu ul li {
display: inline;
font-size: 14px;
list-style: none;
}
.header-top-menu ul li a {
padding: 2px 10px;
display: inline-block;
color: #ddd;
text-decoration: none;
}
.header-top-menu ul li:hover a, .header-top-menu ul li:hover a i {
color: #d6e78d;
}
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css">
<div class="header-top-menu flex-container">
<div class="content-box">
<div class="content-lt">
<ul>
<li>
<a href="mailto:email" title="Envie um e-mail pra gente :)" alt="Envie um e-mail pra gente :)" target="_blank"><i class="far fa-envelope"></i> email</a>
</li>
</ul>
</div>
</div>
</div>
Even Font Awesome using the property of color: inherit
is not working. Some solution?
I know if I add the attribute
color: #ddd;
in the element.header-top-menu ul li a i
right, but there is some way to do this in a general way for the whole site without having to stay set color in all the elements that I want to puttransition color
?– Leonardo Dias