btn
和btn-default
类的button
元素仅与它们包含的文本一样宽。例如: <button class="btn btn-default">Submit</button>
此按钮只能与“提交”一词一样宽。 通过使用附加的btn-block
类来阻止元素,您的按钮将拉伸以填充页面的整个水平空间,其后面的任何元素将流到块下方的“新行”。 <button class="btn btn-default btn-block">Submit</button>
此按钮占用可用宽度的100%。 请注意,这些按钮仍需要btn
类。将Bootstrap的btn-block
类添加到Bootstrap按钮。 btn
和btn-default
类。
testString: 'assert($("button").hasClass("btn") && $("button").hasClass("btn-default"), "Your button should still have the btn
and btn-default
classes.");'
- text: 你的按钮应该有类btn-block
。
testString: 'assert($("button").hasClass("btn-block"), "Your button should have the class btn-block
.");'
- text: 确保所有button
元素都有一个结束标记。
testString: 'assert(code.match(/<\/button>/g) && code.match(/Click here for cat photos.
Things cats love:
Top 3 things cats hate: