--- id: 587d781c367417b2b2512ac0 title: 使用 text-transform 屬性給文本添加大寫效果 challengeType: 0 videoUrl: 'https://scrimba.com/c/cvVZQSP' forumTopicId: 301081 dashedName: use-the-text-transform-property-to-make-text-uppercase --- # --description-- CSS 裏的 `text-transform` 屬性可以改變英文字母的大小寫。 使用這個屬性時,我們無需改變 HTML 元素中的文本也可以統一頁面裏英文的顯示。 下面的表格展示了 `text-transform` 的不同值對文字 “Transform me” 的影響:
結果
lowercase"transform me"
uppercase"TRANSFORM ME"
capitalize"Transform Me"
initial使用默認值
inherit使用父元素的 text-transform 值。
noneDefault:不改變文字。
# --instructions-- 請使用 `text-transform` 屬性把 `h4` 內容文本中的所有字母變成大寫。 # --hints-- `h4` 內容文本中的所有字母均應爲 `uppercase` 大寫 。 ```js assert($('h4').css('text-transform') === 'uppercase'); ``` `h4` 內的原文不應改變。 ```js assert($('h4').text() !== $('h4').text().toUpperCase()); ``` # --seed-- ## --seed-contents-- ```html

Alphabet


Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.

``` # --solutions-- ```html

Alphabet


Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.

```