twitter-bootstrap Bootstrap 拉左拉右
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31445889/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Bootstrap pull-left pull right
提问by Dercni
I just cannot get my head around using these two and how they work. For example:
我只是无法理解使用这两个以及它们是如何工作的。例如:
I have a single row and a single column and within I want to align one item left and one item right.
我有一行和一列,在我想左对齐一个项目和右对齐一个项目。
The following puts "left align me" on the LHS and "right align me" on the RHS but not on the same row with each other. I want the text to be on the same row. I can do this with a table but want to learn how to do it properly. What am I missing?
以下将“左对齐我”放在 LHS 上,“右对齐我”放在 RHS 上,但彼此不在同一行。我希望文本在同一行。我可以用一张桌子来做这件事,但想学习如何正确地做到这一点。我错过了什么?
<div class="container">
<div class="row">
<div class="col-md-3">
Sidebar
</div>
<div class="col-md-9">
<div>
left align me
</div>
<div class="pull-right">
right align me
</div>
</div>
</div>
</div>
回答by AngularJR
Have a look at this Fiddle, I think this is what you are wanting to do here.
看看这个Fiddle,我想这就是你想要在这里做的。
Just using a divwith no given width the divwill take the full width.
I think you meant to be using the class col-xs-push-xx. But to use this you also need to give each div some width.
仅使用div没有给定宽度的 adiv将采用全宽。
我认为您打算使用 class col-xs-push-xx。但是要使用它,您还需要给每个 div 一些宽度。



