【问题标题】:Two different submit buttons on the same line同一行上有两个不同的提交按钮
【发布时间】:2010-07-30 22:20:58
【问题描述】:

我有两个不同表单的两个提交按钮。它们显示在两条不同的行上。是否可以将它们并排放在一行上。

<form action="" method="POST">
        <input type="submit" name = "" value="OK" >
                    </form> 
<form action="" method="POST">
        <input type="submit" name = "" value="Cancel" >
                    </form>

【问题讨论】:

    标签: html forms django-forms


    【解决方案1】:

    另一种方法是更改​​表单标签的css属性:

    form { display: inline; }
    

    示例:http://jsbin.com/omene3/2/edit

    【讨论】:

    • 这对我来说是最好和最快的解决方案。
    【解决方案2】:
    <div style="width:400px;">
        <div style="float: left; width: 130px"> 
            <form id="thisone" action="post_nrs_users.asp" method="post">
                <input type="submit" name = "" value="OK" >
            </form>
        </div>
        <div style="float: right; width: 225px"> 
            <form id="thistoo" action="post_nrs_users.asp" method="post">
                <input type="submit" name = "" value="Cancel" >
            </form>
        </div>
    </div>
    

    【讨论】:

    • 请用文字解释你的答案。
    • 像这样&lt;div style="float: left; padding-left: 50px"&gt; 设置您的样式以控制按钮的位置。
    【解决方案3】:

    当然。使用以下 CSS:

    form { float: left; }
    

    input { float: left; }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-12-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-01
      • 1970-01-01
      相关资源
      最近更新 更多