Twitter-Bootstrap - put simple elements inline

我怕爱的太早我们不能终老 提交于 2019-12-22 01:24:34

问题


Is there anyway to put 2 <a> elements displaying inline?

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.


回答1:


Anchor tags by default should be displayed inline. You must have some extra styling setting them to display as block elements or something similar.

Using your code, here is a working 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 after that. As you've already added class="inline" you can simply just add:

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 scaffolding elements, if you want a full-width row you should use:

<div class="row-fluid">
    <div class="span12">
        <a class="inline">jjj</a>
        <a class="inline">sss</a>
    </div>
</div>


来源:https://stackoverflow.com/questions/15634441/twitter-bootstrap-put-simple-elements-inline

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!