--- id: bad87fee1348bd9aede08845 title: Create a Custom Heading challengeType: 0 videoUrl: '' localeTitle: 创建自定义标题 --- ## Description
我们将通过将标题和放松的猫图像放在同一行中,为我们的Cat Photo App制作一个简单的标题。请记住,Bootstrap使用响应式网格系统,可以轻松地将元素放入行中并指定每个元素的相对宽度。 Bootstrap的大多数类都可以应用于div元素。将第一个图像和h2元素嵌套在一个<div class="row">元素中。将您的h2元素嵌套在<div class="col-xs-8">并将您的图像<div class="col-xs-4">以便它们位于同一行。请注意图像现在的大小是否适合文本?
## Instructions
## Tests
```yml tests: - text: 你的h2元素和最顶层的img元素都应该在带有类rowdiv元素中嵌套在一起。 testString: 'assert($("div.row:has(h2)").length > 0 && $("div.row:has(img)").length > 0, "Your h2 element and topmost img element should both be nested together within a div element with the class row.");' - text: 使用类col-xs-4将最顶层的img元素嵌套在div 。 testString: 'assert($("div.col-xs-4:has(img)").length > 0 && $("div.col-xs-4:has(div)").length === 0, "Nest your topmost img element within a div with the class col-xs-4.");' - text: 使用类col-xs-8h2元素嵌套在div 。 testString: 'assert($("div.col-xs-8:has(h2)").length > 0 && $("div.col-xs-8:has(div)").length === 0, "Nest your h2 element within a div with the class col-xs-8.");' - text: 确保每个div元素都有一个结束标记。 testString: 'assert(code.match(/<\/div>/g) && code.match(/
/g).length === code.match(/
div elements has a closing tag.");' ```
## Challenge Seed
```html

CatPhotoApp

A cute orange cat lying on its back. Three kittens running towards the camera.

Things cats love:

  • cat nip
  • laser pointers
  • lasagna

Top 3 things cats hate:

  1. flea treatment
  2. thunder
  3. other cats
```
## Solution
```js // solution required ```