【问题标题】:hyperlink not in whole button [duplicate]超链接不在整个按钮中[重复]
【发布时间】:2013-02-24 09:13:43
【问题描述】:

我在屏幕上有两个按钮..

 <div class="checksheet">
        <a href="http://some_link" target="_blank">
        <input class="btn btn-large btn-primary" type="button" value='Graph Search'>
      </a>
    </div>
    <div class="nchecksheet">
   <form action="/link" method="POST">
   <input class="btn btn-large btn-primary" type="submit" value='Analyze Topics'   onclick="$('#loading').show();">
    </form>
    <div id="loading" style="display:none; position:relative ;left:860px"><img src="{{ url_for('static', filename='img/newload.gif') }}" alt="" /></div>

</div>

问题是..第一个按钮..在按钮的一小部分上有超链接.. 而“提交”类型的按钮..很好..

我的意思是……整个“提交”按钮都是可点击的。

在第一部分..只有一个很小的条带(按钮的顶部)是可点击的...

我错过了什么。

【问题讨论】:

标签: html


【解决方案1】:

您将输入标签放在锚标签内,这是不可能的。

我猜你正在使用 Twitter 引导程序,其中 btn 类也可以被赋予 &lt;a&gt; 标签并使它们看起来像按钮,所以你可以这样做:

<div class="checksheet">
    <a href="http://some_link" target="_blank" class="btn btn-large btn-primary">
    Graph Search
    </a>
</div>
<div class="nchecksheet">
    <form action="/link" method="POST">
        <input class="btn btn-large btn-primary" type="submit" value="Analyze Topics" onclick="$('#loading').show();">
    </form>
    <div id="loading" class="hide" style="position: relative; left:860px;">
        <img src="{{ url_for('static', filename='img/newload.gif') }}" alt="" />
    </div>
</div>

【讨论】:

  • 它不起作用 :( 是的,它的 twitter 引导程序
  • jsfiddle.net/faridv/UwMpq你能告诉我问题出在哪里吗?
  • 嗯..这很奇怪..它在我的最后不起作用..:(让我检查一下
【解决方案2】:

试试……

<div class="checksheet">
        <input type=button class="btn btn-large btn-primary" onClick="location.href='http://some_link'" value='Graph Search'>
    </div>
     <div class="nchecksheet">
   <input type=button class="btn btn-large btn-primary" onClick="location.href='http://some_link'; onclick="$('#loading').show();" value='Analyze Topics'>
    <div id="loading" style="display:none; position:relative ;left:860px"><img src="{{ url_for('static', filename='img/newload.gif') }}" alt="" /></div>
</div>

【讨论】:

    猜你喜欢
    • 2017-03-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-13
    • 1970-01-01
    相关资源
    最近更新 更多