更改Bootstrap图标之间的空间

时间:2016-06-15 19:39:23

标签: css twitter-bootstrap-3 glyphicons

图标之间的间距太大。如何使这些紧密结合?

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<div>
                                <button class="btn-link glyphicon glyphicon-plus"></button>
                                <button class="btn-link glyphicon glyphicon-info-sign"></button>
                                <button class="btn-link glyphicon glyphicon-download-alt"></button>
                                <button class="btn-link glyphicon glyphicon-zoom-in"></button>
</div>

1 个答案:

答案 0 :(得分:2)

您可以删除按钮上的填充区域:

.btn-link {
  padding:0;
}

.btn-link {
  padding: 0;
}
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<div>
  <button class="btn-link glyphicon glyphicon-plus"></button>
  <button class="btn-link glyphicon glyphicon-info-sign"></button>
  <button class="btn-link glyphicon glyphicon-download-alt"></button>
  <button class="btn-link glyphicon glyphicon-zoom-in"></button>
</div>

如果需要,还可以删除2px边框。