Solved

How to remove padding on a submit button?

Posted on 2008-06-20
4
3,125 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
ID: 21830663
I usually do it with an inline css

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

Author Comment

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

Author Comment

by:bt33
ID: 21830774
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
ID: 21831094
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

810 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