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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T14:40:41+00:00 2026-06-08T14:40:41+00:00

I am trying to build a simply navigation that has rollover states and different

  • 0

I am trying to build a simply navigation that has rollover states and different icons for each item. I am using 3 different sprites for the on/off states for the icons and I have everything working great except I am having trouble positioning the icons themselves to sit flust left and aligned with the text. right now they appear in the top left corner of each list item, i want them to appear just to the left of the text. but when i add margin or padding or positioning it screws with the sprite and when rolled over you see the entire image vs just the portion i want. here is my code:

<div id="navcontainer">
    <ul id="navlist">
        <li><a href="#" class="sub">Subscribe &cent;99/month</a></li>
        <li><a href="#" class="profile">My Profile</a></li>
        <li><a href="#" class="log last">Log Out</a></li>
    </ul>
</div>
#navcontainer  {
    width: 243px;
    height: 200px;
    border: 1px solid #999;
    background-color: #fff;
}

#navcontainer ul  {
    margin: 0;
    padding: 0px;
    list-style-type:  none;
    font-family: 'FranklinGothic-Book', sans-serif;
}

#navcontainer a  {
    display: block;
    padding: 14px 0px 14px 45px;
    width: 198px;
    background-color: #fff;
    border-bottom: 1px solid #eee;
}

#navcontainer a: link, #navlist a:visited {
    color: #000;
    text-decoration: none;
}

#navcontainer a: hover {
    background-color: #cbcbcb;
    color: #000;
}

#navcontainer a.last  {
    border-bottom: 0px;
}

a.sub  {
    display: block;
    width: 20px;
    height: 20px;
    text-decoration: none;
    background: url("http://vpointproductions.com/images/sub.png") no-repeat;
}

a.profile  {
    display: block;
    width: 20px;
    height: 20px;
    text-decoration: none;
    background: url("http://vpointproductions.com/images/profile.png") no-repeat;
}

a.log  {
    display: block;
    width: 20px;
    height: 20px;
    text-decoration: none;
    background: url("http://vpointproductions.com/images/log.png") no-repeat;
}

a.sub: hover, a.profile:hover, a.log:hover  {
    background-position: -20px 0;
}
  • 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-08T14:40:42+00:00Added an answer on June 8, 2026 at 2:40 pm

    You can’t really do what you’re trying to do with a sprite. The only way would be to really space the items out on your sprite so that you don’t see the other elements of the sprite.

    Alternatively you could just use two images per a tag and swap them on hover.

    Another way you could do it would be to place a span inside the a tag and set the background on that rather than on the a tag.

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

Sidebar

Related Questions

I'm trying to build a website that has a Member section, and I'm struggling
I'm trying to build a simply menu with images where the selected has a
When trying to build a simple test program that uses atomic operations, I get
I am trying to build a website with a background image that I want
I am trying to build my own user authentication system (simply because the ones
Im trying to build a feeds application in php in which im using a
I'm trying to build a JAX-RS based web service using IBM RAD 7.5.5 (which
I am trying to build an array that contains arrays of dictionary objects in
I'm trying to build a simple scheduler using Quartz.NET, but when I try to
I'm trying to build a simple HTTP Server using Java, using java.net.ServerSocket = new

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.