Keep two HTML forms on the same line in a paragraph tag

Add this to your css:

form {
    display: inline-block; //Or display: inline; 
}

Fiddle: http://jsfiddle.net/trW82/


add float style to the first form -

style="float: left;"

better yet, create a separate CSS class -

.chatForm {
    float: left;
}

and assign this class to the first form -

<form class="chatForm" ......

You can also set display property of both form to either inline or inline-block -

.chatForm, .declineForm {
    display: inline-block; /* or inline */
}

and then -

<form class="chatForm" .....
<form class="declineForm" ....

Demo.

Check out the sitepoint reference on display and float.

Tags:

Html

Css

Forms