user1438003 user1438003 - 1 year ago 71
HTML Question

Making button go full-width?

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>

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

Answer Source

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


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

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