Thursday 15 May 2014

html - remove gap between input and button -



html - remove gap between input and button -

i'm trying set button right near text field.

here code thought create work

<input class="txt" type="text" name="name"> <button class="btn">submit</button> .txt { display: inline-block; width: 80%; outline: none; margin:0; } .btn { display: inline-block; width: 20%; margin:0; }

http://jsfiddle.net/rm9etsny/

however, there still gap between 2 elements. how can remove it?

thanks

you can set html content inline. remove space without having margin-left negative

<input class="txt" type="text" name="name"><button class="btn">submit</button>

also set them align in horizontal row, need consider giving less % input.

demo - http://jsfiddle.net/rahulb007/rm9etsny/5/

html css

No comments:

Post a Comment