让按钮全宽? [英] Making button go full-width?

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

问题描述

我想要一个按钮占用列的全部宽度,但有困难...

I want a button to take up the full width of the column, but having difficulties...

<div class="span9 btn-block">
    <button class="btn btn-large btn-block btn-primary" type="button">Block level button</button>
</div>

如何使按钮与列宽一样宽? p>

How do I make the button as wide as the column?

推荐答案

这是一个快速和脏的例子。基本上,在CSS:中结合display:block和width:100%。我在IE9和Chrome 21中测试。

This is a quick and dirty example. Basically, combine "display: block" with "width: 100%" in your CSS. I tested in IE9 and Chrome 21.

<html>

<div style="background-color: black">

<button style="display: block; width: 100%;">button</button>

</div>

</html>

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

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