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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:45:44+00:00 2026-05-27T13:45:44+00:00

If I have a button like this one: a#settingsCloseButton { background: url(img/my_account_sprite.png) no-repeat scroll

  • 0

If I have a button like this one:

a#settingsCloseButton {
        background: url("img/my_account_sprite.png") no-repeat scroll 0 -155px transparent;
        display: block;
        height: 14px;
        text-indent: -3000px;
        width: 14px;
    }

I use to write the :hover and :active like this:

a#settingsCloseButton:hover {
        background: url("img/my_account_sprite.png") no-repeat scroll -14px -155px transparent;
    }

a#settingsCloseButton:active {
        background: url("img/my_account_sprite.png") no-repeat scroll -28px -155px transparent;
    }

My Question is: If I will write it only with background-poistion like this would it get me better loading performence:

a#settingsCloseButton:hover {
        background-posiiton: -14px -155px;
    }

a#settingsCloseButton:active {
        background-posiiton: -28px -155px;

    }

It is easier for to duplicate the whole background properties because then I can tell where the image is being taken from (like the first example). but does it means it re-loads it? Is one option loads faster then the other or they are both the same?

thanks,
Alon

  • 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-27T13:45:45+00:00Added an answer on May 27, 2026 at 1:45 pm

    There is no performance penalty incurred in the form of extra loads or anything like that. Once a browser has loaded an image the first time, it has the image in memory and doesn’t need to load it again every time it’s referenced in a stylesheet.

    Setting just the background-position property simply makes it clear that all that’s really changing is the background position. It’s not necessary to repeat the rest of the values (image, repeat, attachment) if they’re not going to change in the :hover and :active states.

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

Sidebar

Related Questions

If I have a button like the one in this image : http://www.freeimagehosting.net/image.php?4cd775814c.png how
I have one image submit button like this <input id=enter name=enter type=image value=Login src=images/btn_login.jpg/>
I have a button with class MyButton defined somewhat like this: .MyButton{ color:black; background:white;}
I have a button like this: <Button android:id=@+id/logout_button android:layout_width=fill_parent android:layout_height=wrap_content android:text=Log out /> and
I have a submit button like this: <input class=create_button name=commit onclick=return validate_activity(); type=submit value=Save>
I have a button that basically looks like this: <Button android:id=@+id/admin_new_questions android:layout_width=fill_parent android:layout_height=wrap_content android:text=See
In Interface Builder components I have Gradient Button I would like to create this
I have 2 radio button with 2 group. The structure is like this Main
I have a windows form simply like this: 1) a button when clicked will
I am doing this in order to have Facebook like button in my page:

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.