How to make two forms side by side in html | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to make two forms side by side in html

30th Dec 2016, 12:34 PM
M SRAV
M SRAV - avatar
4 Answers
+ 4
style="float:left;" in the one and style="float:right;" in the other...
30th Dec 2016, 12:56 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 4
1. Wrap your forms in a <div> and apply float: left; to the wrapper: <div style="float:left;"> <form> input,submit etc </form> </div> 2. Use display:inline-block on your wrapper <div style="width:50%; margin:auto;"> <div style="display:inline-block; width:45%;text-align:center;"> <form> input, submit ... </form> </div> </div> The 2nd example will also center your both forms on the screen. I'll create a code snippet so you can see a working example :)
30th Dec 2016, 12:59 PM
qobus
+ 3
put forms in div as <div style="display: flex;"> <form> </form> <form> </form> </div>
30th Dec 2016, 12:55 PM
Sandeep Chatterjee
0
ok
19th Jan 2017, 8:54 AM
kingsley oparaku
kingsley oparaku - avatar