Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML|CSS: Space between input buttons

Tags:

html

css

I have a problem in which I have a space between these two buttons.

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

like image 757
Shawn Mclean Avatar asked Jan 19 '10 18:01

Shawn Mclean


People also ask

How do you put a space between input fields in HTML?

The simplest way to add a space in HTML (besides hitting the spacebar) is with the non-breaking space entity, written as &nbsp; or &#160;. Multiple adjacent non-breaking spaces won't be collapsed by the browser, letting you “force” several visible spaces between words or other page elements.

How do I add a space between text and Button in HTML?

You can add more space between a button and text box by using “margin” attribute. If you want to add right side more space then add “margin- right”, for left side “magin-left”, for top side “margin-top”, for bottom “margin-bottom”.


1 Answers

The line feed between the two <input>s creates a space between them on the page. You have to remove the line feed, or use this trick :

<input id="NeedBtn" class="PostBtn" type="button" /><!-- --><input id="ProvBtn" class="PostBtn" type="button" /> 
like image 147
Pikrass Avatar answered Sep 18 '22 09:09

Pikrass