Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7496087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T18:28:26+00:00 2026-05-29T18:28:26+00:00

Is there any quick and easy way to use a sprite to create a

  • 0

Is there any quick and easy way to use a sprite to create a rollover on an input?

I am not that familiar with inputs and specifically what you do regarding rollovers on inputs. I understand using sprites on tags. I also get the concept of using Javascript onMouseOut with two images, but I would really prefer to use a sprite. They seem to work best and I won’t have to worry about flickering.

Here is an image I am working with:
enter image description here

Here is the code I am working with:

<style>
#newsletterSubmit{background:url(/Images/Buttons/submit.png) 0 0 no-repeat;display:block;width:90px;height:50px;text-indent:-9000px;}
</style>

 <input id="newsletterSubmit" type="image" src="Images/Buttons/Submit.png" onmouseover="document.getElementById('newsletterSubmit').style.backgroundPosition='0px -50px';" onmouseover="document.getElementById('newsletterSubmit').style.backgroundPosition='0px 0px';" />
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T18:28:27+00:00Added an answer on May 29, 2026 at 6:28 pm

    You don’t need javascript or onmouseover, it can all be done with CSS. Here is a simple example:

    <input type="submit" value="Submit">
    
    input {
        display:block;
        text-indent:-9000px;
        border:0;
        padding:0;
    
        background:url(/Images/Buttons/submit.png) 0 0 no-repeat;
        width:90px;
        height:50px;
    }
    
    input:hover {
       /* Move the background image up 50px (height of button) */
       background-position:0 -50px;  
    }
    

    Demo: http://jsbin.com/ihafib

    You’ll want to check the coordinates of your sprite and crop it appropriately to make sure everything lines up correctly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any easy/quick way to yank into vim's last search register (/)? From
Is there a quick and easy way to check if any of my $_POST
Is there a quick/easy way to have tabular data and have a button that
is there any way of quick jump to the last modified line? eclipse has
A quick question, for a quick answer (since I'm not finding any): Is there
For a given form in a database, is there a quick/easy way to find
Is there any quick guide/reference to list all the countries and its states/provinces? Like
Quick question, I was curious if there is any difference between a database table
Hey just a quick question for any experts out there. I have a site
Hey guys, quick question for any experts out there. I am allowing users to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.