0

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

<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>
4

1 回答 1

1

简单地给class="btn-group"元素<form>

尝试这样的事情:

<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>

最后你的 HTML 应该是这样的:http: //jsfiddle.net/hyWnt/1/


为 Bootstrap 2.3.2 更新了 jsfiddle:http: //jsfiddle.net/msturdy/HyfKZ/4/

变化是:

新的 CSS:

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

然后代码应该是:

<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>
于 2013-08-14T18:23:35.537 回答