How to display the More than one Submit Button on the same line in Browser?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • xtremebass
    New Member
    • Nov 2008
    • 38

    How to display the More than one Submit Button on the same line in Browser?

    Hi Bytes.


    i have 3 submit buttons namely click1,click2 and click3 .

    if i press the any of one submit button page submitted appropriate page correctly, But the problem is display the all submit buttons in single line but it displays line by line (one line after another button displayed) .


    code i used is :
    Code:
    <html>
    <body>
    
    <form name="frm1" method="post" action="clk1.html">
    <input type="submit" value="click1">
    </form>
    
    <form name="frm2" method="post" action="clk2.html">
    <input type="submit" value="click2">
    </form>
    
    <form name="frm3" mthod="post" action="clk3.html">
    <input type="submit" value="click3">
    </form>
    
    </body>
    </html>

    is it possible to display all buttons in sigle line(like click1 cilk2 click3) . help me.
    Last edited by acoder; Mar 18 '09, 02:56 PM. Reason: Fixed code tags
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    the best would probably be to float the <form>s. (form is a block element, thus the line break. making it inline wouldn't help because it must not contain block elements then, which is not very useful)

    other options are to position it (absolute or relative) or to put it in already aligned block elements (like a table, ...)

    Comment

    • xtremebass
      New Member
      • Nov 2008
      • 38

      #3
      Thanks for your suggestion. it helps me a lot.

      Comment

      • Stomme poes
        New Member
        • Aug 2007
        • 14

        #4
        forms can be set to display: inline. If it were less code and could afford to act like text, I'd do it.

        The invalid code posted doesn't have any block children, but if we decided to write correctly and add a block child, we'd just make that an inline too:
        Code:
        <form action="">
          <div>
            <input type="submit">
          </div>
        </form>
        
        form, form div {
          display: inline;
        }

        Comment

        Working...