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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:28:34+00:00 2026-06-06T04:28:34+00:00

Can I create button, use a background image that changes on hover and on

  • 0

Can I create button, use a background image that changes on hover and on active, and have the active state show an image that extends outside of the bounds of the anchor? Here’s my sprite:

https://dl.dropbox.com/u/7737304/menu-sprite1.png

The top half of the sprite is ‘hover’, the bottom is ‘active’. I don’t anything below the solid bar to be a clickable link, and I don’t want to set a width as the menu text will set on top and extend beyond the left and right edges of the image.

I’ve attempted to assign the background image to the parent li tag, which works for ‘hover’ but I can’t make it work for ‘active’.

Any ideas?

CSS

.navigation li:hover{
background: transparent url(../images/menu-sprite.png) center -86px no-repeat;
}
.navigation a{
color: #e8e8e8;
font-weight: bold;
text-transform: uppercase;
padding:0.5em 0.8em;
}
.navigation a:hover{
color: #fff;
}
.navigation a.active {
color: #fff;
}
  • 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-06T04:28:35+00:00Added an answer on June 6, 2026 at 4:28 am

    Do you mean something like this ?

    The anchor ‘expands’ when active, but doesn’t change the flow, since it uses a negative margin to make it actually the same size as before.

    So: add the amount of padding you want to expand the anchor, then add the same amount as a negative margin. (You do need the anchor to be a block or inline-block element, since otherwise it can’t use margin)

    No need for JavaScript with this method.

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

Sidebar

Related Questions

How can i create a id as a newguid for a button and use
I can use .button() to create beautiful submit buttons, but the rest of the
I am trying to create a button that can pop up the speech input
So, I can create an input button with an image using <INPUT type="image" src="/images/Btn.PNG"
How can i create a button with no text and an image centered horizontally
I'm trying to create a CSS3 button which includes an image using multiple background.
How can I create button using pure CSS with a sold background color and
How can I create a person photo button like the one in contact info
How can I create an action so when a button is clicked the Apple
Can any one tell me how to create the rounded button (Circular Button) in

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.