Html 如何将引导按钮移动到左侧

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14478427/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 05:11:20  来源:igfitidea点击:

How to move the bootstrap button to left side

htmlcsstwitter-bootstrap

提问by iJade

Here is my bootstrap code

这是我的引导代码

    <div class="input-append" align="center">
    <input type="text" name="q" class="span2 search-query" placeholder="Snipp or Tag"
    />
    <button type="submit" class="btn">Search</button>
    <button class="btn btn-primary active"><i class="icon-white icon-plus"></i> plus</button>
    <button class="btn btn-primary active"><i class="icon-white icon-bullhorn"></i> Goto</button>
</div>

And here is a jsfiddleHow give top-padding and how to give some space in between the buttons and move the plus and goto button to right side

这是一个jsfiddle如何给顶部填充以及如何在按钮之间留出一些空间并将加号和转到按钮移动到右侧

采纳答案by Sowmya

add another div for those 2 buttons and give float:right

为这两个按钮添加另一个 div 并给出 float:right

And for gap between them give margin

而对于他们之间的差距给 margin

button{margin-right:6px}

DEMO UPDATED

演示更新

回答by Sujay sreedhar

if you want to float right you use the built in class "pull-right"

如果你想向右浮动,你可以使用内置的“pull-right”类

<div class="pull-right">...</div>

and for search more looking one will be

和搜索更多寻找一个

<form class="form-search">
    <div class="input-append" >
    <input type="text" class="span2 search-query input-large" placeholder="search posts,users..">
    <button type="submit" class="btn"><i class="icon-search"></i></button>
    </div>

and for keeping distance you can use margin

为了保持距离,您可以使用边距

margin:10px