/    Sign up×
Community /Pin to ProfileBookmark

Problem showing additional image on hover

I’ve been searching the web for this and can’t find an answer other than using JS to do this:

I have a <div> image on a web page, and every time I hover over that image, I want another image to appear under it. When I try this with CSS I get flickering and the original image moves down with it.

Any help would be appreciated!

[QUOTE]

<style type=”text/css”>
}
#showPic
{
position:absolute;
z-index:1;
}
#showPic:hover
{
margin-top:100px;
display: block;
width: 200px;
height: 200px;
background-image: url(IMAGE URL);
background-repeat: no-repeat;
background-position:absolute;
visibility:visible;
{
</style>
<div id=”showPic”>
<img src=”IMAGE URL”>
</div>

[/QUOTE]

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@ZICKONEZEROauthorApr 26.2012 — Ok I figured it out. Here's the code that worked:


<style type="text/css">

#sBux .hov

{

position:absolute;

top:0px;

left:0px;

}

#sBux:hover

{

margin-top:100px;

display:block;

width: 200px;

height: 200px;

background-image:url(IMAGE URL);

background-repeat: no-repeat;

background-position:absolute;

visibility:visible;

}

</style>

<div id="sBux">

<img class="hov" src="IMAGE URL">

</div>
[/QUOTE]
×

Success!

Help @ZICKONEZERO spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...