freeCodeCamp/curriculum/challenges/chinese/03-front-end-libraries/bootstrap/create-a-bootstrap-headline...

2.0 KiB
Raw Blame History

id title challengeType videoUrl localeTitle
bad87fee1348bd9aec908846 Create a Bootstrap Headline 0 创建一个Bootstrap标题

Description

现在让我们从头开始构建一些东西来练习我们的HTMLCSS和Bootstrap技能。我们将构建一个jQuery游戏我们很快将在jQuery挑战中使用它。首先使用文本jQuery Playground创建一个h3元素。使用text-primary Bootstrap类为h3元素着色,并将其与text-center Bootstrap类text-center

Instructions

Tests

tests:
  - text: 在页面中添加<code>h3</code>元素。
    testString: 'assert($("h3") && $("h3").length > 0, "Add a <code>h3</code> element to your page.");'
  - text: 确保您的<code>h3</code>元素具有结束标记。
    testString: 'assert(code.match(/<\/h3>/g) && code.match(/<h3/g) && code.match(/<\/h3>/g).length === code.match(/<h3/g).length, "Make sure your <code>h3</code> element has a closing tag.");'
  - text: 应该使用<code>text-primary</code>类来对你的<code>h3</code>元素进行着色
    testString: 'assert($("h3").hasClass("text-primary"), "Your <code>h3</code> element should be colored by applying the class <code>text-primary</code>");'
  - text: 应用类<code>text-center</code>应该使<code>h3</code>元素居中
    testString: 'assert($("h3").hasClass("text-center"), "Your <code>h3</code> element should be centered by applying the class <code>text-center</code>");'
  - text: 你的<code>h3</code>元素应该有<code>jQuery Playground</code>文本。
    testString: 'assert.isTrue((/jquery(\s)+playground/gi).test($("h3").text()), "Your <code>h3</code> element should have the text <code>jQuery Playground</code>.");'

Challenge Seed


Solution

// solution required