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

The Archive Base Latest Questions

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

The problem only happens on input[type=text] in Webkit. No matter what I do, there

  • 0

The problem only happens on input[type="text"] in Webkit. No matter what I do, there is the equivalent of an extra padding: 1px 0 0 1px (top and left only) on the element.

A similar problem happens in Gecko, input[type="text"] has an equivalent extra padding: 1px 0 0 1px and input[type="button"] has an extra padding: 1px 0 0 0.

Here’s a JSFiddle showing you everything I’ve tried, and nothing works: http://jsfiddle.net/PncMR/10/

Interestingly, when you set the line-height of all the elements to 0 ( http://jsfiddle.net/PncMR/11/ ), the only unaffected elements are the ones with the problems, so I’m assuming that the browser is defaulting to a specific line-height, and I’m now looking for a way to override it.


I’ve found nothing in the webkit base styles that would do this, but feel free to check yourself:

http://trac.webkit.org/browser/trunk/Source/WebCore/css/html.css

This is not a moz-focus-inner problem, or an appearance: none problem, or a box-sizing problem, or an outline problem and I can’t find any other solutions.


Edit: See my answer below for the vertical padding problems, but I’m still looking for a solution to the extra padding-left: 1px equivalent on text-inputs only in webkit and gecko. ( http://jsfiddle.net/PncMR/14/ )

  • 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-28T08:17:58+00:00Added an answer on May 28, 2026 at 8:17 am

    In Webkit

    The extra vertical “padding” on input[type="text"] in Webkit is because you cannot give text inputs a line-height value of less than normal, which isn’t a specific value, but varies depending on the typeface.

    I know this is the cause, but I cannot find where the input would be getting this style, because it doesn’t appear in the Webkit UA stylesheets.

    In Gecko

    The extra vertical “padding” on input[type="text"] and input[type="button"] in Gecko is due to user-agent stylesheet containing:

    input {
        line-height: normal !important;
    }
    

    and !important declarations in the user-agent stylesheet cannot be overidden in any way.

    Conclusion

    You can’t go under line-height: normal in Webkit, and you can’t have anything other than line-height: normal on these elements in Gecko, so the best solution is to always style these elements with line-height: normal to get the best consistency, which isn’t really a nice solution. Ideally, we’d be able to override all UA styles.


    Neither of these account for the extra 1px of what acts like text-indent that only appears on input[type="text"] in both rendering engines.


    People who care about this, should voice their opinions on these two Bugzilla threads:

    • https://bugzilla.mozilla.org/show_bug.cgi?id=697451
    • https://bugzilla.mozilla.org/show_bug.cgi?id=349259
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This problem is only in IE. Consider the following HTML: <html> <body> <div style='position:absolute;left:1em;right:1em;top:1em;bottom:1em;overflow:auto;>
The problem happens only in IE7: When I go to the next tab some
My only problem is making them line up three-across and have equal spacing. Apparently,
The problem is only happening with one file when I try to do a
[Edit: This problem applies only to 32-bit systems. If your computer, your OS and
My example is similar to this - The only problem is I cannot rewrite
I am stuck in between of a problem where only one pass of regular
I like using LINQ to SQL. The only problem is that I don't like
I’ve got the basics of a content rotator done, the only problem is it
Here is my code, everything is working fine the only problem is with the

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.