【发布时间】:2016-12-27 23:23:40
【问题描述】:
我有一个列、一行和三个嵌套列。每列中都有一个 div 按钮。我没有故意使用引导默认按钮,我创建了自己的,只是你看到一列被吃掉了。
请看图片:
我几乎可以肯定 HTML 没有任何问题。 Main div col 设置为 col-md-1 以测试较小规模内的嵌套响应元素。有谁明白为什么 content(button) 的行为因为它对于列来说太大了,为什么在我的情况下列被吃掉了?
代码如下:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<div class="col-md-1 col-xs-1">
<div class="row" style="padding:0 !important;margin:0 !important;">
<div class="col-md-1 col-xs-1" style="padding:0 !important;margin:0 !important;">
<button class="button" type="button" style="background-color: green; height: 20vmin; width: 100%; border:none; display: block;"></button>
</div>
<div class="col-md-10 col-xs-10" style="padding:0 !important;margin:0 !important;">
<button class="button" type="button" style="background-color: red; height: 20vmin; width: 100%; border:none; display: block;"></button>
</div>
<div class="col-md-1 col-xs-1" style="padding:0 !important;margin:0 !important;">
<button class="button" type="button" style="background-color: black; height: 20vmin; width: 100%; border:none; display: block;"></button>
</div>
</div>
</div>
【问题讨论】:
-
弄乱 cols 填充或边距没有什么好处,除非你通过 sass 来做这件事/而不是按照它应该做的方式来做。
-
Muhammad Usman,outline:none 不起作用,它什么也不做。不过还是谢谢你
-
yBrodsky。将 main col 设置为 col-md-4 效果很好,至少看起来像
-
Teuta Koraqi,列给出了很好的响应结果...
标签: html css twitter-bootstrap