Background button will not hover in different color

Christian Luneborg

And the arrow on the right button disappeared. When hovered the blue color changes to a lighter blue with darker arrow and text.

HTML

<div class="fluid FindHome-div">
    <h1>
        <a href="http://www.ntreisinnovia.net/ntr/idx/index.php?key=b74b4ef49443e4ac6699324016bbaec5" class="FindHome" target="_blank">Find your home</a>
    </h1>
 </div>

CSS

.FindHome {
     background-color:#09F; 
     width:300px; 
     border:1px solid #09F;      
     padding:10px 40px 10px 15px;  
     border-radius:5px; 
     display:block; 
     margin-left:auto; 
     margin-right:auto;   
     background: #09F url('../img/arrow.png') no-repeat; 
     background-position:320px center;   
     margin-bottom:35px; 
     overflow: hidden; 
     text-decoration:none; 
     color:#ffffff;
 }

.FineHome a:hover {background:#ffffff;}
.FindHome-div{display:inline-block;}

JSFIDDLE

Pevara

There are 2 mistakes in your css:

  • .FineHome should be .FindHome
  • The a has the class .FindHome, and is not a child as your css presumes. You should change .FindHome a:hover to a.FindHome:hover or .FindHome:hover

http://jsfiddle.net/nA4P9/11/

Off topic:
May I also suggest that your choice of naming makes things quite hard to read and difficult to reuse imo. I would go for something like this:

HTML

 <div class="fluid find-home">
    <h1>
        <a href="..." class='cta-button' target="_blank">Find your home</a>
    </h1>
 </div>

css

 .cta-button {
         background: #09F; 
         ...
     }
    .cta-button:hover {
         background: #fff;
         ...
    }
    .find-home {
         display: inline-block;
         ...
    }

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

CSS: Change Background Color on Hover

From Dev

background color not changing on hover css

From Dev

CSS - Change button background color on hover

From Dev

How to set a different background-color to a disabled button with QSS?

From Dev

Choosing different background color for divs on button click

From Dev

Hover to change background image instead of background color

From Dev

Fill button with a different color on hover

From Dev

Fade background color of button on hover css

From Dev

change background color of component on hover

From Dev

Extending the Background color on Hover

From Dev

Change image background color on hover

From Dev

hover button background color remains on mobile

From Dev

button hover color is not working

From Dev

background color change on hover with background-size

From Dev

Change background color on hover

From Dev

CSS: Change Background Color on Hover

From Dev

background color not changing on hover css

From Dev

Button background not changing on hover

From Dev

Set button hover or onmouseover background color

From Dev

change the background color of the button

From Dev

Change the background color of a button

From Dev

change background color of component on hover

From Dev

button hover color is not working

From Dev

Button background color in webpart

From Dev

how to use different background color for radio button

From Dev

Disable hover background color change on ion-button Ionic 2

From Dev

CSS change body background-color on button hover?

From Dev

CSS Button color only change word's background color no whole button when hover

From Dev

Button hover Color Change

Related Related

HotTag

Archive