I am trying to create a simple image link button that when I move my mouse on it, it gets a bit larger.
I managed to do it with this simple code below but now I just want to move also the paragraph when the image is getting larger..
Any hints on how I can select and move the paragraph when I hover over the image?
<div id="rightImage">
<a href="http://blabla.com" target="_blank"> <img src="images/image.jpg" alt="image" onmouseover="this.className='mouseOver'" onmouseout="this.className='mouseOut'" /></a>
<p>paragraph</p>
</div>
#rightImage
{
width:275px;
height:275px;
float:left;
position:relative;
}
.mouseOver
{
width:300px;
height:300px;
top:-40px;
z-index:1;
position:absolute;
box-shadow:2px -2px 10px 3px #888, inset 2px -2px 10px 3px #888;
}
.mouseOut
{
width:275px;
height:275px;
float:left;
margin-right:52px;
box-shadow:2px -2px 10px 3px #888, inset 2px -2px 10px 3px #888;
}
This enlarges the image, increases the size of the shadow and keeps the <p> element visible.
(EDIT: I forgot to encode the angled braces around the p)
Perhaps it’s what you need?