Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3134
  • Last Modified:

How to remove padding on a submit button?

I'm trying to make a submit button, with an image as background-image, which works perfectly in firefox but in IE6 and 7 there is some padding I can't seem to get rid of.

My HTML code:
<input type="submit" value="" id="submit">

My CSS code:
height:29px;
width:105px;
padding:0;
margin:0;
border:1px;
background-image:url(srchbtn.gif);

Any ideas how to get rid of the padding? IE versions and forms/inputs are always so annoying.
0
bt33
Asked:
bt33
  • 3
1 Solution
 
gamebitsCommented:
I usually do it with an inline css

<input type="submit" value="" id="submit" style="padding: 0px; margin: 0px;">
0
 
bt33Author Commented:
inline css? display:inline;? doesn't seem to work for me.
0
 
bt33Author Commented:
Now I think of it, the background-image doesn't start at the topleft, I assumed it was padding but maybe the background-image isn't set correctly somehow.
0
 
bt33Author Commented:
Got it working, not completely sure how but here is the code I use now:

<input type="submit" value="" style="padding:0; margin:0; position:absolute; top:0; left:193px; background-image:url(srchbtn.gif); border:0px; height:29px; width:105px;">
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now