html - Bootstrap : pull left and right in panel footer breaks footer

标签 html css twitter-bootstrap

我有一个 Bootstrap 面板,底部有两个按钮:

    <div class="panel-footer">
        {{ Form::open( array('route' => array('dogs.edit', $dog->id), 'method' => 'get', "class" => 'col-lg-6 ')) }}
            {{ Form::submit("Edit", array('class' => 'btn btn-default')) }}
        {{ Form::close() }}
        {{ Form::open( array('route' => array('dogs.destroy', $dog->id), 'method' => 'delete', "class" => 'col-lg-6 ')) }}
            {{ Form::submit("Delete", array('class' => 'btn btn-default')) }}
        {{ Form::close() }}
    </div>

每个按钮的表单都有 pull-leftpull-right 类,因此它们都 float 到面板页脚的任一侧。

float 效果正常,但按钮现在位于页脚之外:

enter image description here

我尝试使用网格系统而不是拉式助手,但我得到了相同的结果。

我也四处寻找解决方案(我认为这一定很常见)并且没有找到不需要使用自定义 css 覆盖 Bootstrap 的解释。

是否可以仅使用 Bootstrap 来解决这个问题,还是我需要加入自己的 css 来解决这个问题?

最佳答案

只需在按钮后添加一个带有 clearfix 的 div

<div class="clearfix"></div>

关于html - Bootstrap : pull left and right in panel footer breaks footer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23872755/

相关文章:

python - BeautifulSoup 文本挖掘 - 变量字符串

html - 我的子 div 的不透明度一直从其父级继承。我怎样才能阻止这种行为?

html - 具有重复背景图像和 float div 的 Div 容器

html - 将元素放在单行中,包括宽度为 100% 的表格

CSS Transitions 对比三星 Galaxy Tab 2

jQuery css() 无法使用可见性

css - IOS 5 上的边界半径会减慢触摸事件

css - 在 Bootstrap 4 中使用 Font Awesome

html - 将 iframe 放在 div 的中心

javascript - 如何让这些按钮向右浮动并垂直对齐一些垂直间距