Background image to display on hover

I have a button that, when it freezes, I would also like the background image to be displayed. (This arrow is an explanation of the button). Too many questions, but I could not fully customize the answers to work for me.

HTML looks like

<div id="header_feedback">
    <a href="#contactForm">
        <img title="Add an Event" src="./img/header_feedback.png" alt="Give us your Feedback"/>
    </a>
</div>

CSS then

#header_feedback
{margin-left:730px;
margin-top:-135px;
position:absolute;}

#header_feedback:hover
{
background: url ('./img/addevent_tip.png');
}

Any ideas are very welcome!

+3
source share
3 answers

The main problem here is not your CSS. Itagi's answer correctly identified a minor issue in which you cannot have a space between urland parens / address.

But there are two more big problems:

  • URL- : background: url('./img/addevent_tip.png'); . , , . , background: url('/img/addevent_tip.png');, background: url('../img/addevent_tip.png');
  • , , . div , , . , (, , , , ) CSS.
+1

:

#header_feedback:hover
{
background: url('./img/addevent_tip.png');
}

"url" URL

0
#header_feedback a img{ display:none;}
#header_feedback a:hover img{display:block}
0

All Articles