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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:38:56+00:00 2026-06-14T08:38:56+00:00

Check out this code sample of a button and an anchor: http://jsbin.com/ecitex/2/edit I’m trying

  • 0

Check out this code sample of a button and an anchor: http://jsbin.com/ecitex/2/edit

I’m trying to make them identical in all browsers. But differences remain, and different differences in every browser (tried Chrome, Safari, Firefox, IE8).

Which CSS normalizations am I missing?


Update:
Per suggested:

  • I added line-height: 50px (although my user agent’s (Chrome’s) default line-height for button elements is normal, and still it vertically centers text – how?!)
  • I added cursor: pointer to normalize mouse cursors.

http://jsbin.com/ecitex/11/edit

So, now check out the result in Firefox: notice the padding on the button?
Then check out the result in IE8: whoa, notice how the two are completely and utterly different?!


Update 2:

It seems that IE’s problems are known and non-resolvable: http://www.quirksmode.org/css/tests/mozie_button2.html

I haven’t found anything on Firefox’s padding though. (The quirksmode article mentions an issue with Mozilla, but that’s a different issue.)


Update 3:

Awesome, we fixed the Firefox issue: http://jsbin.com/ecitex/15/edit

Okay, so far every single answer has been providing part of the solution so there’s not really one single best answer. I’ll grant the best answer to the person that either:

  • Explains why we have to specify a line-height: 50px to vertically center text in an a, while a button has vertically centered text with a mere line-height: normal.
  • Provides a solution for the IE issue.
  • 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-14T08:38:58+00:00Added an answer on June 14, 2026 at 8:38 am

    You can remove that extra padding in Firefox by using:

    button::-moz-focus-inner {
        border: 0;
        padding: 0;
    }
    

    Here’s a good explanation from Eric Meyer about line height which hopefully explains why you need to explicitly set it as 50px: http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/.

    Here’s some new CSS that fixes the font size issue in IE:

    button, a {
      display: inline-block;
      -webkit-appearance: none;
      -moz-appearance: none;
      appearance: none;
      margin: 10px 0;
      padding: 0px;
      height: 50px;
      border-width: 0;
      background-color: Red;
      color: White;
      font-family: sans-serif;
      font-weight: normal;
      font-size: inherit;
      text-decoration: none;
      line-height: 50px;
      cursor: pointer;
      font-size: 100%;
    }
    button {
      #width:0px;
      overflow: visible;
    }
    button::-moz-focus-inner {
      border: 0;
      padding: 0;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Check out this code sample from Scott Guthrie's blog: http://weblogs.asp.net/blogs/scottgu/image_43366964.png Notice item is a
Check out this jsbin . I have a form with a custom button that
Possible Duplicate: White space at bottom of anchor tag Check out this sample page
Could you please check out this piece of code: #include <vector> class A {
Check out this piece of JavaScript code: (function (w, d) { var loader =
Please check this code out it compiles and runs absolutely fine.. The question is
I am using 'git' to checkout chromium code by following this document: http://code.google.com/p/chromium/wiki/UsingGit And
Check out this demo by FaTaL. It is explained in his blog that he
check this out: template <class T> class Test: public T { public: void TestFunc()
This is my code of a sample details gathering page,where once the customer enters

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.