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

  • Home
  • SEARCH
  • 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 4531870
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T13:57:28+00:00 2026-05-21T13:57:28+00:00

Using a method I’ve done before but having issues. Not sure if it’s a

  • 0

Using a method I’ve done before but having issues. Not sure if it’s a sprite or what.. Basically you have two versions of an image saved into one file with them stacked on top of each other and use CSS to adjust the margins when hovering. Here’s an example of it working successfully: http://minimalpluscreative.com

Trying to do the same thing here, but running into issues with overflow:hidden; not working. Instead, the the full (double) image is shown. Here’s what it looks like: http://cl.ly/023p1I1D1W0W3a1T1q1R It should be just the top half of the image with overflow:hidden; preventing the other half from showing.

Help? Some kind of syntax error I’m sure…

HTML:

    <div id="work" class="sub">
        <h3>MUSIC VIDEOS</h3>
        <img id="show_fire" class="thumbnail sprite" src="images/daniel_gomes_soundoffire_sprite.png" />
    </div>

CSS:

.sprite {
        width:140px; 
        height:61px; 
        overflow:hidden;
}
.sprite:hover {
        margin-top:-61px;
}
  • 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-21T13:57:28+00:00Added an answer on May 21, 2026 at 1:57 pm

    I’ve never seen this done before except with background images, but I don’t see why not… it just seems like you need a lot of extra css, and extra html to get it to work as opposed to a background image.

    As was said earlier, it’s hard to see the problem without seeing your actual code in context, but based on what I see, there could be a few potential things wrong:

    You need to wrap the image in a containing element, and assign the width, height and overflow to that. Hidden overflow will hide what’s outside of the boundaries that div contains. The image element is the image, it doesn’t contain the image, so setting it to overflow:hidden isn’t going to hide andything, and assigning it a width will just resize it, not “crop” it (which is the effect you’re going for). So you’d need something like:

    <div id="work" class="sub">
        <h3>MUSIC VIDEOS</h3>
        <a class="sprite" href="#">
            <img id="show_fire" class="thumbnail" src="images/daniel_gomes_soundoffire_sprite.png" />
        </a>
    </div>
    

    with this css:

    .sprite {
        width:140px; 
        height:61px; 
        overflow:hidden;
    }
    .sprite img {
        margin-top: 0;
    }
    .sprite:hover img {
        margin-top: -61px;
    }
    

    I suggest you use ‘a’ as the containing element, as not all browsers will recognize the hover pseudo-class on tags other than anchor tags.

    I know you think using an image instead of a background image is simpler, but using background images, you can accomplish all this with only one element and less css.

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

Sidebar

Related Questions

Using the method Application.Restart() in C# should restart the current application: but it seems
I've done scaffolding using the method described here http://wiki.rubyonrails.org/rails/pages/ScaffoldGenerator However, I want to know
I am posting a very simple form using a method I have used frequently
Should I be using this method of throwing errors: if (isset($this->dbfields[$var])) { return $this->dbfields[$var];
I am writing a Clone method using reflection. How do I detect that a
I'm deserializing a class called Method using .NET Serialization. Method contains a list of
Is there a way to Invoke an overloaded method using reflection in .NET (2.0).
I would like to pass an argument(s) to a method being defined using define_method,
I got a program that writes some data to a file using a method
Is there a (standardized) way to get the name of the current method using

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.