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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:07:15+00:00 2026-05-26T22:07:15+00:00

I am having a problem, for a while I have been trying to figure

  • 0

I am having a problem, for a while I have been trying to figure out how to resolve this issue. I will describe it very well below…

I am trying to use an image as a sprite image for an UL list. It should show an icon with text next to it, both the icon and the text should link to somewhere.

My first example look how I want it to be. When the font-size is set to 10px it looks ok…
sprite ok

As soon as I change the font-size from 10px to 16px…

sprite not ok

Here is the CSS and HTML

CSS

#post-meta-wrapper{
    list-style: none;
    margin:20px 0 20px 20px;
    width:400px;
}

#post-meta-wrapper li {
    width:100%;
    color: #44495B;
    border-top: 1px dotted #CCC;
    color: #999;
    font-size: 10px;
    line-height: 28px;
    margin: 0px 0px 0px 0px;
    padding: 0px 0px 0px 0px;
    text-indent: 0px;
}
#post-meta-wrapper li a{
    background: url(http://i.imgur.com/Bcps8.png) no-repeat 0px -183px;
    padding-left:15px;
}

#post-meta-wrapper .meta-img {
    background:#fff;
    width: 15px;
    height: 10px;
    margin: 0px 0px 0px 0px;
    padding: 0px 0px 0px 8px;
    overflow: hidden;
}

#post-meta-wrapper a:hover,
#post-meta-wrapper .active{
    background: url(http://i.imgur.com/Bcps8.png) no-repeat 0px -195px;
    width: 15px;
    height: 10px;
}

The HTML

<ul id="post-meta-wrapper">
    <li class="author">
        <a href="#"><span class="meta-img">Test link</a>
    </li>
    <li class="author">
        <a href="#" class="active"><span class="meta-img">Test link</a>
    </li>
    <li class="author">
        <a href="#"><span class="meta-img">Test link</a>
    </li>
    <li class="author">
        <a href="#"><span class="meta-img">Test link</a>
    </li>
    <li class="author">
        <a href="#"><span class="meta-img">Test link</a>
    </li>
    <li class="author">
        <a href="#"><span class="meta-img">Test link</a>
    </li>
   
</ul>

JSFiddle Examples

This is the first one with the font-size: 10px http://jsfiddle.net/jasondavis/Mt87G/4/

This is the MESSED UP one with the font-size: 16px
http://jsfiddle.net/jasondavis/Mt87G/5/

Help me?

Ok I know I could just change the sprite image to have huge spaces around each object in the image and then you wouldn’t notice this problem, but I would really like to resolve this issue the right way. I mean is it possible to do what I am trying to do with just CSS or does the image need to be spaced out? I have seen other sprite images where they are together close like mine and I have seen some where everything is like 100px apart.

Please help me if you know how to resolve this, I have tried eveything I can think of without any luck yet. I need to do this on a mass scale so I would like to get it done correctly now before I do that. Thank you for any help

  • 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-26T22:07:15+00:00Added an answer on May 26, 2026 at 10:07 pm
    1. Close the span
    2. Set width, height, float and margin-top of this span to align with base of line height

    Try this:
    http://jsfiddle.net/Mt87G/19/

    CSS

    #first a{
         font-size: 10px;
         padding-left: 5px;
         line-height: 12px;
    }
    #second a{
        font-size: 22px;
        line-height: 25px;
        padding-left: 5px; 
    }
    .meta-img{
        background: url(http://i.imgur.com/Bcps8.png) no-repeat 0px -183px;
        width: 13px;
        height: 12px;
        float: left;
    }
    #first .meta-img{
        margin-top: 4px
    }
    #second .meta-img{
        margin-top: 7px
    }
    

    HTML

    <p id="first">
        <a href="#">
            <span class="meta-img"></span>Test link
        </a>  
    </p>    
    
    <p id="second">
        <a href="#">
            <span class="meta-img"></span>Test link
        </a> 
    </p>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I've been trying to figure this out for a while now and seem
Hey dudes.i am having this problem while symlinking. I have successfully deployed a ruby
I've been having this problem for a while and it's driving me nuts. I'm
Been sitting here for hours now trying to figure this out, so a bit
I have been stuck with this problem for a while now, and I just
I have been trying to solve Project Euler's problem #59 for a while, and
I have been trying for quite a while to work out how to accomplish
I've been having a lot of problems trying to figure out how to use
I'm having a problem that I've been trying to solve for a while, but
I have a flash file menu i am having problem while link it to

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.