M
M
Maxim2015-11-27 15:46:29
css
Maxim, 2015-11-27 15:46:29

How to change FontAwesome text color on hover?

Hello. I have this code in CSS, I made the text change to white on hover.

.addtocart-bar span.addtocart-button input.addtocart-button{
  border: 1px solid @brand-primary;
  color: @btn-default-color;
  border-radius: 0;
  background: #fff;
  padding: 5px 10px 5px 30px;
  font-size: 16px;
  text-transform: uppercase;
  transition: all 0.3s;
  &:hover{
    background: @brand-primary;
    color: @w-text-color;
    transition: all 0.3s;
  }
}
.addtocart-bar span.addtocart-button{
  margin-left: 10px;
  position: relative;
  &:before{
    content: "\f07a";
    display: inline-block;
    font: normal normal normal 16px/1 FontAwesome;
    color: @text-color;
    position: absolute;
    top: 6px;
    left: 10px;
  }
}

How can I make the FontAwesome icon change from black to white when hovering the mouse over the button? Below is the image when hovering the mouse.
55fdd6d2ce6844c282a20f4c417f6f79.jpg
Tried to add
&:hover{
    	color: @w-text-color;
  }

After left: 10px; before }, but it didn't help. How to be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail, 2015-11-27
@maximtop

Are you sure that you have white color in @w-text-color? This is 1, 2 if you need to color the icon, refer to it, for example like this

&:hover .fa{
    color: @w-text-color;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question