gpt4 book ai didi

html - 在 Bootstrap 3 中对齐 div

转载 作者:技术小花猫 更新时间:2023-10-29 11:36:12 24 4
gpt4 key购买 nike

在 Bootstrap 3 中有没有办法让 div 右对齐?

我知道偏移的可能性,但我想将格式化的 div 对齐到其容器的右侧,同时它应该在全 Angular 移动 View 中居中。 “向右拉”类不再起作用。是他们忘了更换它还是我遗漏了一些明显的东西?

<div class="row">
<div class="container">
<div class="col-md-4">
left content
</div>
<div class="col-md-4 col-md-offset-4">
<!-- The next div has a background color and its own paddings and should be aligned right-->
<!-- It is now in the right column but aligned left in that column -->
<div class="yellow_background">right content</div>
</div>
</div>
</div>

Shure 我知道如何在 CSS 中做到这一点,但它可以在纯 bootstrap 3 中完成吗?

最佳答案

类 pull-right 在 Bootstrap 3 中仍然存在查看'helper classes' here

右拉定义为

.pull-right {
float: right !important;
}

没有关于样式和内容的更多信息,很难说。

它绝对适合这个 JSBIN当页面宽度超过 990px​​ 时 - 这是 col-md 样式开始时,Bootstrap 3 首先是移动设备。

Bootstrap 4

请注意,对于 Bootstrap 4,.pull-right 已替换为 .float-right https://www.geeksforgeeks.org/pull-left-and-pull-right-classes-in-bootstrap-4/#:~:text=pull%2Dright%20classes%20have%20been,based%20on%20the%20Bootstrap%20Grid .

关于html - 在 Bootstrap 3 中对齐 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19758313/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com