freeCodeCamp/curriculum/challenges/chinese-traditional/03-front-end-development-li.../bootstrap/create-a-bootstrap-headline.md

1.4 KiB
Raw Blame History

id title challengeType forumTopicId dashedName
bad87fee1348bd9aec908846 創建一個 Bootstrap 標題 0 16812 create-a-bootstrap-headline

--description--

現在,來運用 HTML、CSS 和 Bootstrap 從頭開始做點東西。

接下來將會搭建一個 jQuery playground以便在後續的 jQuery 課程中使用它。

首先,創建一個包含 jQuery Playground 文本內容的 h3 元素。

通過給 h3 元素設置 Bootstrap 的 text-primary class 屬性來爲其上色,然後添加 Bootstrap 的 text-center class 屬性使其文本居中顯示。

--hints--

爲頁面添加一個 h3 元素。

assert($('h3') && $('h3').length > 0);

確保 h3 元素有一個閉合標籤。

assert(
  code.match(/<\/h3>/g) &&
    code.match(/<h3/g) &&
    code.match(/<\/h3>/g).length === code.match(/<h3/g).length
);

爲了確保成功上色,h3 元素應該具有 text-primary class。

assert($('h3').hasClass('text-primary'));

爲了確保文本居中顯示,h3 元素應該具有 text-center class。

assert($('h3').hasClass('text-center'));

h3 元素文本內容爲 jQuery Playground

assert.isTrue(/jquery(\s)+playground/gi.test($('h3').text()));

--seed--

--seed-contents--


--solutions--

<h3 class="text-primary text-center">jQuery Playground</h3>