--- 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” 的影响:
Value | Result |
---|---|
lowercase | "transform me" |
uppercase | "TRANSFORM ME" |
capitalize | "Transform Me" |
initial | 使用默认值 |
inherit | 使用父元素的 text-transform 值。 |
none | Default:不改变文字。 |
Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.
Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.