Jump to content

"Double" Image (2-in-1)


Joshua4550

Recommended Posts

Hey guys,

 

Just a quick question - If I had a button, say 200px.. but it had 2 similar images on it, for eg: 2 buttons, the first 100px height would be one button, then the next 100px of height would be the same button, but lighter (for hovor-over effects)

 

Is there an easy way to use this as one image, and have it so when you hovor over, it shows the bottom 100px - otherwise it shows the top 100px?

 

Thanks in advance!

Link to comment
https://forums.phpfreaks.com/topic/202668-double-image-2-in-1/
Share on other sites

Figured it.

 

For anyone wanting the same thing:

 

<style type="text/css">
div.button {
background:url(/imgs/button.gif) no-repeat 0 0;
width:200px;
height:100px;
}
div.button:hover {
background-position:0 -100px;
}
</style>

<div class="button"></div>

(button.gif is 200x200 px)

Link to comment
https://forums.phpfreaks.com/topic/202668-double-image-2-in-1/#findComment-1062311
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.