Bootstrap 3中是否有一种方法可以右对齐div?
我知道可能会发生偏移,但是我想将格式化的div对齐到其容器的右侧,而该div应该在全角移动 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中执行此操作,但是可以在纯自举3中完成吗?
最佳答案
Bootstrap 3中仍然存在右上拉类
见'helper classes' here
右拉定义为
.pull-right {
float: right !important;
}
没有有关样式和内容的更多信息,这很难说。它肯定会在这个JSBIN中拉
当页面的宽度大于990像素时(即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。