带有Bootstrap的固定宽度按钮 [英] Fixed width buttons with Bootstrap

查看:442
本文介绍了带有Bootstrap的固定宽度按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Bootstrap是否支持固定宽度按钮?目前,如果我有2个按钮,保存和下载,按钮的大小会根据内容而变化。

Does Bootstrap support fixed width buttons? Currently if I have 2 buttons, "Save" and "Download", the button size changes based on content.

还有什么是正确的扩展Bootstrap? p>

Also what is the right way of extending Bootstrap?

推荐答案

也可以在按钮上使用 .btn-block

如果父节点是一个固定宽度的元素,按钮将会展开为所有宽度。您可以将现有标记应用于容器,以确保固定/流体按钮仅占用所需的空间。

If the parent is a fixed width element the button will expand to take all width. You can apply existing markup to the container to ensure fixed/fluid buttons take up only the required space.

<div class="span2">
<p><button class="btn btn-primary btn-block">Save</button></p>
<p><button class="btn btn-success btn-block">Download</button></p>
</div>

这篇关于带有Bootstrap的固定宽度按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆