Ryan S
Ryan S

Reputation: 3268

CSS Hover Effect

I need to show an additional image once the user hovers over button. How would you go around doing this ideally just using CSS.

You can see what I need exactly on the image below, when the users hovers on the brochure button, the view brochure button appears.

enter image description here

Upvotes: 3

Views: 242

Answers (2)

Billy Moon
Billy Moon

Reputation: 58619

with css alone, if you can put an element inside the hovered object, you can do like this:

fiddle here: http://jsfiddle.net/Q67hB/

html:

<div id="one">all the time
    <div id="two">only on hovering one</div>
</div>

css:

#two{
  display: none;  
}
#one:hover #two{
  display: block;
}

Upvotes: 5

Jim Blackler
Jim Blackler

Reputation: 23179

In CSS

button:hover {
    background-image: url(someImage.png);
}

Upvotes: 0

Related Questions