--- id: bad87fee1348bd8acde08812 title: Center Text with Bootstrap challengeType: 0 videoUrl: '' localeTitle: 中心文本与引导程序 --- ## Description
现在我们正在使用Bootstrap,我们可以将我们的标题元素集中在一起,使其看起来更好。我们需要做的就是将类text-center添加到我们的h2元素中。请记住,您可以通过用空格分隔每个类来为同一个元素添加几个类,如下所示: <h2 class="red-text text-center">your text</h2>
## Instructions
## Tests
```yml tests: - text: 应用类text-center应该使h2元素居中 testString: assert($("h2").hasClass("text-center")); - text: 您的h2元素仍应具有类red-text testString: assert($("h2").hasClass("red-text")); ```
## Challenge Seed
```html

CatPhotoApp

Click here for cat photos.

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 ```