tags:

views:

905

answers:

3

I have a problem in which I have a space between these two buttons as seen in the image below:

alt text

The code is as follows:

<input id="NeedBtn" class="PostBtn" type="button" />
<input id="ProvBtn" class="PostBtn" type="button" />

.PostBtn
{
   background: url(../Images/Buttons/PostButtonF.png) no-repeat;
   width: 50px;
   height: 28px;
   border: none;
   margin: 0;
   padding: 0;
}
#NeedBtn
{
   background-position: 0 0;
}
#ProvBtn
{
   background-position: -50px 0;
}

How do I remove that space?

Browser: Firefox 3.5

IE8

+7  A: 

The line feed between the two <input> creates a space between. Just glue them. :)

Pikrass
I dont understand that.
Shawn Mclean
The line feed is causing the space, he means to type it like this: <input id="NeedBtn" class="PostBtn" type="button" /><input id="ProvBtn" class="PostBtn" type="button" /> instead of having them on separate lines.
ryanulit
Put <input id="NeedBtn" class="PostBtn" type="button" /><input id="ProvBtn" class="PostBtn" type="button" /> on one line.
BarrettJ
Sorry if I didn't use clear words, English isn't my native language.
Pikrass
Also, if you need to have them on different lines for code organization, try this... <input id="NeedBtn" class="PostBtn" type="button" [newline]/><input id="ProvBtn" class="PostBtn" type="button" />
Kerrick
A: 

I see they have a set height and width. Adding overflow: hidden should hide the whitespace outside of your defined width. That is an alternative to eliminating the whitespace, as @Pikrass noted. Usually the whitespace is a IE problem, I've not noticed it in FF before.

neatlysliced
A: 

Try using a CSS reset - it may solve the browser discrepancy : http://meyerweb.com/eric/tools/css/reset/reset.css

vectran