button
elements with the btn
and btn-default
classes are only as wide as the text that they contain. For example:
<button class="btn btn-default">Submit</button>
This button would only be as wide as the word "Submit".
By making them block elements with the additional class of btn-block
, your button will stretch to fill your page's entire horizontal space and any elements following it will flow onto a "new line" below the block.
<button class="btn btn-default btn-block">Submit</button>
This button would take up 100% of the available width.
Note that these buttons still need the btn
class.
Add Bootstrap's btn-block
class to your Bootstrap button.
btn
and btn-default
classes.
testString: assert($("button").hasClass("btn") && $("button").hasClass("btn-default"), 'Your button should still have the btn
and btn-default
classes.');
- text: Your button should have the class btn-block
.
testString: assert($("button").hasClass("btn-block"), 'Your button should have the class btn-block
.');
- text: Make sure all your button
elements have a closing tag.
testString: assert(code.match(/<\/button>/g) && code.match(/Click here for cat photos.
Things cats love:
Top 3 things cats hate: