3

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

1
  • The short answer .button:hover .view-brochure {display:block} We really need html Commented Apr 20, 2011 at 11:31

2 Answers 2

5

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;
}
Sign up to request clarification or add additional context in comments.

1 Comment

thanks for your easy to use, and well explained answer :) Appreciate
0

In CSS

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

2 Comments

I don't remember very well, but I think this does not (always) work in internet explorer. So you should test it well!
Apart from that, the other answer is better, especially to position, and play around.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.