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 8355337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:49:55+00:00 2026-06-09T09:49:55+00:00

These Sprite buttons are driving me bonkers. I can almost get them to work,

  • 0

These Sprite buttons are driving me bonkers. I can almost get them to work, but not quite.

I’m playing with this very simple sprite image:

jp2Rollover Sprite

I’ve got a jsfiddle project >> HERE << if you want to see that, but the code is below if you just want to look at it.

For my CSS, I have the following:

#menu {
  left:10px;
  top:50px;
  height:300px;
  width: 147px;
  position:fixed;
}
.sprite {
  background: url('http://www.jp2code.net/logos/jp2Rollover.png') 0px -100px no-repeat;
  height:50px;
  padding-left: 50px;
  width:147px;
  z-index:1;
}
.sprite a {
  background-position: 0px 0px;
  color:Red;
  vertical-align: middle;
}
.sprite a:hover {
  background-position: 0px -50px;
  color:Yellow;
}
​

With that, my HTML is simple and small:

<html>
<body>
  <ul id="menu">
    <li class="sprite">You Are Here</li>
    <li class="sprite"><a href="#A">Contact</li>
    <li class="sprite"><a href="#B">Projects</li>
  </ul>
</body>
</html>​

I can’t seem to get my active link image (at position 0) or my hover link image (at position 50) to show.

Also, I’d like to find a way to make the entire rectangular region (50 x 147) the hyperlink.

Could someone help me, please?

  • 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-06-09T09:49:57+00:00Added an answer on June 9, 2026 at 9:49 am

    Is that what you want to get: http://jsfiddle.net/PZh9F/37/ ?

    CSS:

    #menu { left:10px; top:50px; height:300px; width: 147px; position:fixed; }
    .sprite { background: url('http://www.jp2code.net/logos/jp2Rollover.png') 0px -100px no-repeat; height:50px; padding-left: 50px; width:147px; z-index:1; }
    .sprite a { background-position: 0px 100px; color:Red; vertical-align: middle; }
    .sprite.current { background-position: 0px 0px; }
    .sprite:hover { background-position: 0px -50px; }
    .sprite:hover a { color:Yellow; }
    

    And HTML:
    ​

    <html>
    <body>
      <ul id="menu">
        <li class="sprite current">You Are Here</li>
        <li class="sprite"><a href="#A">Contact</li>
        <li class="sprite"><a href="#B">Projects</li>
      </ul>
    </body>
    </html>​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a cloud and a man sprite, these are both drawn separately but
These are for two separate codecademy exercises. They both pass me but I'm not
This little OpenLayers.Control.EditingToolbar from is inserted by default: It's not really evident what these
So my script works perfectly, but here is the issue, I have buttons (Sprite
These days I design some algorithms in python, but find first two greatest value
I am have buttons like this: <button type=button class=img img_button_bla onclick=...>Bla!</button> The img class
Currently I have an Array that is having 9 buttons pushed to it. This
Is there a standard way of using the jquery-ui icon sprite without attaching them
I just ran into an awkward issue that has an easy fix, but not
This has been driving me nuts. I've worked with SWFObject in the past which

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.