twitter-bootstrap 如何在同一个div中的引导按钮之间添加空格?

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

How to add space between bootstrap buttons in same div?

htmltwitter-bootstrap

提问by aftab

I have two buttons inside same div i want to add space between these buttons. How can i achieve that without adding custom css. Is there any bootstrap solution for it ?

我在同一个 div 中有两个按钮,我想在这些按钮之间添加空间。我如何在不添加自定义 css 的情况下实现这一点。是否有任何引导解决方案?

main.html

主文件

 <div class="btn-group pull-right">
    <button class="btn btn-default" type="button">View/Edit</button>
    <button class="btn btn-default" type="button">Edit Ratings</button>
 </div>

回答by Sean Mishra

This is a rudimentary solution using bootstrap only. You could play around with the col-md-*to achieve desired gap.

这是仅使用引导程序的基本解决方案。您可以使用col-md-*来实现所需的间隙。

<div class="btn-group pull-right row">
  <div class="col-md-4"><button class="btn btn-default" type="button">View/Edit</button></div>
  <div class="col-md-1"></div>
  <div class="col-md-4"> <button class="btn btn-default" type="button">Edit Ratings</button></div>
 </div>

回答by Rob

I would highly recommend linking a css file and tampering with div margin isolated to the designated class.

我强烈建议链接 css 文件并篡改与指定类隔离的 div 边距。

IE)

IE)

<div class="Name1">
    <button class="Name2" type="button">View/Edit</button>
    <button class="Name3" type="button">Edit Ratings</button>
</div>

CSS:

CSS:

.name2 button
{
  margin-left:5px;
}

Otherwise,

否则,

An HTML alternative would be...

一个 HTML 替代将是...

&nbsp;