CSS bootstrap css中li中元素的右对齐
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20774856/
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
right alignment of element in li in bootstrap css
提问by zach57
I want to align li
values right most of the screen. but it does not appear.
我想li
在屏幕的大部分位置对齐值。但它没有出现。
Codepan: http://codepen.io/
Codepan:http://codepen.io/
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<ul class="nav navbar-nav navbar-right">
<li><a href="../navbar-static-top/">Static top</a></li>
<li><a href="../navbar-fixed-top/">Fixed top</a></li>
</ul>
</div>
</div>
text-align:right;
or align="right"
does not help
text-align:right;
或align="right"
没有帮助
采纳答案by thgaskell
回答by zach57
Try using the Bootstrap pull-right class inside of your ordered list tags like so:
尝试在有序列表标签中使用 Bootstrap pull-right 类,如下所示:
<ul class="pull-right">The text you want aligned to the right</ul>
回答by brouxhaha
Add text-align: right;
to the ul
instead of the li
添加text-align: right;
到ul
而不是li