Change Background Color And Image On Hover
I have a square with a logo inside. On hover in the square, I want the background color to change as well as the color of the logo. I have the following code:
Solution 2:
Cleaner HTML (since img tag needs a source, you can change it for a div):
<div class="pure-u-1 pure-u-md-1-3">
<divclass="project", id="project1"><divclass="pure-img"></div></div>
And the CSS:
.project {
background-color: #f5f4f4;
margin: 00.5em2em;
padding: 4em4em;
}
#project1:hover {
background-color: red;
}
.pure-img{
background-image: url(http://dummyimage.com/600x400/000/fff);
width: 80px;
height: 78px;
}
#project1:hover.pure-img {
background-image: url(http://dummyimage.com/600x400/666/0011fc);
}
and the fiddle http://jsfiddle.net/h6gwwox6/1/
Post a Comment for "Change Background Color And Image On Hover"