Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent <form> line break between two <form> tags

Tags:

html

css

I want to prevent line breaks between two forms I have.

So basically:

<form action="...">
<input type="submit" />
</form>
LINE BREAK HERE
<form action="...">
<input type="submit" />
</form>

I want to remove the line break. I want the input buttons to be on the same line, like a menu.

like image 744
elvispt Avatar asked Oct 04 '10 11:10

elvispt


2 Answers

form {
    display: inline;
}
like image 187
Vivien Barousse Avatar answered Oct 02 '22 19:10

Vivien Barousse


I think this is the correct solution:

form { display: inline-block; }

The inline-block value is used for the purpose of laying out native block-level elements inline. Those elements will still remain blocks.

Changing the model for an element from block to inline is a radical move because it may mess things up depending on what the contents of the element are.

For this particular issue, using inline-block is the way to go.

like image 30
Šime Vidas Avatar answered Oct 02 '22 18:10

Šime Vidas