html - why is there space between controls if margin and padding are set to 0? -


i have div containing 2 input elements of type text , label between them. user define interval (like 4 - 5). display on same line. 3 controls have margin , padding set 0. firebug confirms that. still there space between them. how come ? space come ?

it whitespace (newlines / spaces) between elements.

see these examples understand

<input type="text" /><label>-</label><input type="text" /> 

and

<input type="text" /> <label>-</label> <input type="text" /> 

or

<input type="text" /> <label>-</label> <input type="text" /> 

will render differently.

demo: http://jsfiddle.net/rs2qq/


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -