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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:06:44+00:00 2026-05-12T19:06:44+00:00

My goal here is to make a button. I want the text to sit

  • 0

My goal here is to make a button. I want the text to sit vertically in the middle of the image, and horizontally offset by 22px. The image is 144px by 29px. Here’s the code:

CSS:

<style type="text/css">
a.button{
width:144px;
height:29px;
background-image:url('images/btnOff.gif');
color:#000;
text-decoration:none;
line-height:28px;
padding-left:22px;
}

a:hover.button{
background-image:url('images/btnOn.gif');
}

HTML:

<a href="download.php" class="button">Download</a>

It works exactly as I expected in IE, but in FF, I just get the text (without the new line-height) with a little bit of the background image showing, and the right side of the image after the text is lopped off. It appears to me that neither height nor width nor line-height are being applied properly.

Is there something I am doing wrong? Is there a better way to accomplish my goal?

  • 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-12T19:06:45+00:00Added an answer on May 12, 2026 at 7:06 pm

    Add in this code:

    display:block;
    

    Anchors are an inline element, and therefore don’t typically have a height and width attribute.

    Once it’s a block, don’t use line height, just use the box model as usual. Margins for the outside, padding for the inside, and height/width for any other futzing that’s necessary.

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

Sidebar

Related Questions

Here's my list that I want to expand/collapse: My goal is simply to toggle
Okay, here goes: the goal is to make regexp that matches BLABLA BLA B
My goal is to make an apprequest button in my app that invites friends.
The goal here is maximum conversion of users to an application. I tried to
My goal here is to open temp.php, explode by ### (line terminator), then by
The goal here is to take some list of coordinates, like [[1,2],[3,4],[7,1]] , then
I have a project here the goal is to merge multiple Access DB's into
Here is my ultimate goal... to take this xml file.. <?xml version=1.0?> <Songs> <Song>
Here's my ultimate goal in all of this. I have a viewcontroller with a
Here is the example: http://jsfiddle.net/FdT23/4/ The goal is that when you hover your mouse

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.