css - 右对齐按钮

标签 css bootstrap-4

我知道这一定非常简单,但我正在尝试仅使用 bootstrap 4 类在窗口右侧设置一个按钮。它必须与文本在同一行。

<html>
<head>
</head>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
    <body>
        <div class="row">
            <h3 class="one">Text</h3>
            <button class="btn btn-secondary pull-right">Button</button>
        </div>
    </body>
</html>

密码在here

最佳答案

Bootstrap 4 uses .float-right与 Bootstrap 3 中的 .pull-right 相反。另外,不要忘记将行与列正确嵌套。

<div class="row">
    <div class="col-lg-12">
        <h3 class="one">Text</h3>
        <button class="btn btn-secondary float-right">Button</button>
    </div>
</div>

关于css - 右对齐按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41894792/

相关文章:

html - 如果屏幕上有足够的空间,将 table 并排放置

html - css:chrome 的 -moz-linear-gradient 的等价物是什么

javascript - :focus state of form to affect rules for parent container 的简单 CSS3 或轻量级 java 方式

css - 如何使用 Bootstrap 以特定方式订购数组

html - CSS 中的 vh 和百分比?

javascript - 防止重新加载页面的某些部分

javascript - webkit 外观 - textarea 背景 : none

reactjs - 在 React 中 axios http 调用后打开 bootstrap 模式

javascript - 如何编辑选择表单箭头? ( Bootstrap 4)

css - Bootstrap 4 中是否有类似 reverse sr-only 的东西?