div
元素。 Bootstrap具有不同的列宽属性,具体取决于用户屏幕的宽度。例如,手机屏幕较窄,笔记本电脑屏幕较宽。以Bootstrap的col-md-*
类为例。这里, md
表示中等, *
是指定元素应该有多少列的数字。在这种情况下,正在指定中型屏幕(例如笔记本电脑)上的元素的列宽。在我们正在构建的Cat照片应用程序中,我们将使用col-xs-*
,其中xs
表示超小(如超小型手机屏幕), *
是指示列宽多少列的列数元素应该是。通过将所有三个嵌套在一个<div class="row">
元素中,然后将它们中的每一个<div class="col-xs-4">
元素中,将Like
, Info
和Delete
按钮并排放置。 row
类应用于div
,按钮本身可以嵌套在其中。 row
的同一div
元素中。
testString: 'assert($("div.row:has(button)").length > 0, "Your buttons should all be nested within the same div
element with the class row
.");'
- text: 每个Bootstrap按钮都应嵌套在自己的div
元素中,类别为col-xs-4
。
testString: 'assert($("div.col-xs-4:has(button)").length > 2, "Each of your Bootstrap buttons should be nested within its own div
element with the class col-xs-4
.");'
- text: 确保每个button
元素都有一个结束标记。
testString: 'assert(code.match(/<\/button>/g) && code.match(/