Solved

How to remove padding on a submit button?

Posted on 2008-06-20
4
3,123 Views
Last Modified: 2008-06-28
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
Comment
Question by:bt33
  • 3
4 Comments
 
LVL 28

Expert Comment

by:gamebits
Comment Utility
I usually do it with an inline css

<input type="submit" value="" id="submit" style="padding: 0px; margin: 0px;">
0
 

Author Comment

by:bt33
Comment Utility
inline css? display:inline;? doesn't seem to work for me.
0
 

Author Comment

by:bt33
Comment Utility
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
 

Accepted Solution

by:
bt33 earned 0 total points
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now