-2

I would like to show text when the mouse hovers over a button or <a> tag.

For example, I have this button with some text:

Original button

I have managed to make it larger when the mouse hovers over the button:

Larger button on hover

What I would like to do instead is keep the text and image on top and display some text beneath the button. Can anyone suggest how I might do this?

1
  • 2
    Post you code.. Commented Apr 10, 2017 at 10:07

2 Answers 2

1

Not sure if thats what you are looking for since you didn't include your code...

div {
  display: none;
  margin-left: 10px;
}

a:hover+div {
  display: block;
}
<a><img src='http://vignette1.wikia.nocookie.net/planetside2/images/4/4d/Scythe_Side_View_Icon.png/revision/latest?cb=20130426065845'></a>
<div>Display Whatever</div>

Sign up to request clarification or add additional context in comments.

Comments

0
  1. Add hover state to parent element and styles to child

    .parent .child {display: none}
    .parent:hover .child {display: block}
    
  2. Remember to put text you want to show in front of picture (position: absolute or/and z-index manipulation)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.