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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.