Html Twitter-Bootstrap - 将简单元素内联
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15634441/
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
Twitter-Bootstrap - put simple elements inline
提问by itsme
Is there anyway to put 2 <a>
elements displaying inline?
无论如何要放置<a>
显示内联的2 个元素?
i tryed :
我试过:
<div class="form-inline">
<a>jjj</a>
<a>sss</a>
</div>
and also
并且
<div class="row-fluid">
<a class="inline">jjj</a>
<a class="inline">sss</a>
</div>
but it doesn't work.
但它不起作用。
回答by James Donnelly
Anchor tags by default should be displayed inline
. You must have some extra styling setting them to display as block
elements or something similar.
默认情况下应显示锚标记inline
。您必须有一些额外的样式设置它们以显示为block
元素或类似的东西。
Using your code, here is a working JSFiddle.
使用您的代码,这是一个有效的JSFiddle。
Inspect your page to find out where the anchor's display
is being set and either modify that or set the element to display:inline
afterthat. As you've already added class="inline"
you can simply just add:
检查您的页面以找出display
设置锚点的位置,然后修改它或将元素设置为display:inline
之后。正如您已经添加的那样,class="inline"
您只需添加:
a { display:block; /* Pre-existing code */ }
a.inline {
display:inline;
}
Also as a note I don't think row-fluid
is designed to work without Bootstrap's other scaffoldingelements, if you want a full-width row you should use:
另外作为一个说明,我认为row-fluid
没有 Bootstrap 的其他脚手架元素就不能工作,如果你想要一个全宽的行,你应该使用:
<div class="row-fluid">
<div class="span12">
<a class="inline">jjj</a>
<a class="inline">sss</a>
</div>
</div>