Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Displaying Two Form Buttons Inline

Tags:

html

css

I've got two form buttons like this:

<input type="submit" value="Post"/> <input type="button" value="Cancel"/>

They are displaying one below each other.

How can I display them inline?

like image 910
Hirvesh Avatar asked Feb 18 '11 11:02

Hirvesh


People also ask

How do I show two buttons inline?

If you have multiple buttons that should sit side-by-side on the same line, add the data-inline="true" attribute to each button. This will style the buttons to be the width of their content and float the buttons so they sit on the same line.

How do I put two forms side by side in HTML?

style="float:left;" in the one and style="float:right;" in the other... The 2nd example will also center your both forms on the screen.

Can there be 2 forms in HTML?

You can have as many forms as you need on a HTML page. As long as your script for processing the forms knows which form is which and processes them accordingly. You may have multiple scripts, one for each form.

How do you make two block elements inline?

The most common and traditional way (inline-block) The most common way to place two divs side by side is by using inline-block css property. The inline-block property on the parent placed the two divs side by side and as this is inline-block the text-align feature worked here just like an inline element does.


1 Answers

<span style="display: inline;">
  <input type="submit" value="Post"/> <input type="button" value="Cancel"/>
</span>

http://jsfiddle.net/UQ7xv/

like image 125
alexl Avatar answered Oct 05 '22 16:10

alexl