ncrouch25 ncrouch25 - 1 year ago 45
HTML Question

How to make link_to links change color on hover

I'm trying to get 3 of my links to change color on hover here is the css that I have

a {
color: #5c8a36;
}

a:hover {
text-decoration: none;
color: #5c8a36;
}

.home_links:hover,
.home_links:focus {
color: #5c8a36;
}


<%= link_to "Business Development", business_development_path, :class => 'home_links', :style => 'color: white'; %>




For some reason with this setup the link doesn't change on hover. I'm not sure what to do to make it work. Any suggestions are appreciated.

EDIT:
I want these specific links to appear white and then on the hover change color to the same as the rest of the links.

Answer Source

use this it works for you

 <%= link_to "Business Development", business_development_path, :class => 'home_links', :style => 'color: white'; %>



  <style type="text/css">
         .home_links:hover{
           color:#57a22b!important;
         }
     </style>