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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:10:20+00:00 2026-05-25T18:10:20+00:00

i am attempting to change an input to look exactly the same as an

  • 0

i am attempting to change an input to look exactly the same as an anchor tag, but for some reason there is a 1/2px gap on the left before text starts. There is also a 1/2px gap on top.

Any idea where these gaps are coming from?

(I have removed padding, margins and borders).

exactly the same problem on safari and firefox.

  • 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-25T18:10:21+00:00Added an answer on May 25, 2026 at 6:10 pm

    Here’s the best I could come up with on making an <input type="button" /> appear the same as an <a> element

    example jsfiddle

    Safari, Chrome, and IE all seem to cooperate pretty well with the following:

    input[type="button"], a {
        margin:0;
        padding:0;
        border:0;
        cursor:pointer;
        font:12px/15px Helvetica, Arial, sans-serif;
        color:blue;
        text-decoration:underline;
    }
    

    However Firefox (I’m using 6.0.1) required a bit more finesse:

    input[type="button"] {
        line-height:15px!important;
    }
    
    input[type="button"]::-moz-focus-inner { 
        border:0; 
        padding:0; 
    }
    

    This -moz-focus-inner appears to be the culprit for the extra spacing around the element, both border and padding are set in the internal browser stylesheet (goto resource://gre-resources/forms.css in FF to see the stylesheet)

    That said Firefox still produced 1 extra pixel above the text that I couldn’t figure out how to remove, though when toggling the button or anchor there was no line-height change meaning the parent div didn’t change heights due to this 1px when toggling the elements.

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

Sidebar

Related Questions

Attempting a dynamic style change below, but the function falls silent. I've used JSHint,
I'm attempting to change the style of a button using the :checked and :unchecked
I'm attempting to use the #define directive to change all of ulong to unsigned
I'm attempting to compile code in a text file to change a value in
I am attempting to capture when a text input field's value is changed. I
Using Bootstrap's typeahead javascript plugin, I'm attempting to change the data-source attribute via jQuery's
I am attempting to dynamically change the "src" attribute of a form submit button
I'm attempting to change the text of a label in a piece of C#
I'm attempting to change the built in .Net culture fr-CA, using the following method:
I'm attempting to change the data in PartialView within my view via a dropdownlist

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.