本文介绍了为什么Twitter Bootstrap 2 btn-group不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有可能使它工作?这是我的代码(我在表中使用它):

 < div class =btn-group> 
< td>< a class =btn btn-mini btn-infohref ={{URL :: to('characters / {{$ player-> name')}}>查看< / A>< / TD>
< td> {{Form :: open(array('method'=>'DELETE','route'=> array('players.destroy',$ player-> id))) }}
{{Form :: submit('Delete',array('class'=>'btn btn-mini btn-danger'))}}
{{Form :: close() }}< / TD>
< / div>


解决方案

简单地给 class = btn-group添加到< form> 元素: b
$ b 尝试类似这:

 < td> 
< div class =btn-group>




为Bootstrap 2.3.2更新了jsfiddle:

新变化有:

新CSS:

  div.btn-group + form.btn-group {
margin-left:-5px;
display:inline;
}

然后代码应该是:

 < td> 
< div class =btn-group>
< div class =btn-group>
< span class =btnstyle =display:none>< / span>
< / div>
< form method =POSTaction =http:// localhost:8000 / account / management / characters / delete / 23accept-charset =UTF-8class =btn-group> ;
< input name =_ tokentype =hiddenvalue =7GKfarNh81RKu1Y5Dts8bYeFjOG7i8bLdD0CdNLa>
< input name =_ methodtype =hiddenvalue =DELETE>
< input class =btn btn-mini btn-dangertype =submitvalue =Delete>
< / form>
< / div>
< / td>


Is there any possibility to make it work? Here's my code (I'm using it in a table):

<div class="btn-group">
    <td><a class="btn btn-mini btn-info" href="{{ URL::to('characters/{{ $player->name') }}">View</a></td>
    <td>{{ Form::open(array('method' => 'DELETE', 'route' => array('players.destroy', $player->id))) }}
    {{ Form::submit('Delete', array('class' => 'btn btn-mini btn-danger')) }}
    {{ Form::close() }}</td>
</div>

simply give class="btn-group" to the <form> element:

Try something like this:

<td>
    <div class="btn-group">
        <a class="btn btn-mini btn-info" href="{{ URL::to('characters/{{ $player->name') }}">View</a>
        {{ Form::open(array('class' => 'btn-group', 'method' => 'DELETE', 'route' => array('players.destroy', $player->id))) }}
        {{ Form::submit('Delete', array('class' => 'btn btn-mini btn-danger')) }}
        {{ Form::close() }}
    </div>
</td>

your HTML at the end should look something like this: http://jsfiddle.net/hyWnt/1/


Updated jsfiddle for Bootstrap 2.3.2 : http://jsfiddle.net/msturdy/HyfKZ/4/

the changes are:

New CSS:

div.btn-group + form.btn-group {
    margin-left: -5px;
    display:inline;
}

And the code should then be:

<td>
    <div class="btn-group">
        <div class="btn-group">
            <a href="{{ URL::to('characters/'. $player->name) }}" class="btn btn-mini btn-info">View</a>
            <span class="btn" style="display:none"></span>
        </div>
        <form method="POST" action="http://localhost:8000/account/management/characters/delete/23" accept-charset="UTF-8" class="btn-group">
            <input name="_token" type="hidden" value="7GKfarNh81RKu1Y5Dts8bYeFjOG7i8bLdD0CdNLa">
            <input name="_method" type="hidden" value="DELETE">
            <input class="btn btn-mini btn-danger" type="submit" value="Delete">
        </form>
    </div>
</td>

这篇关于为什么Twitter Bootstrap 2 btn-group不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-27 09:08