text-transform
属性用于更改文本的外观。这是一种方便的方法,可确保网页上的文字始终如一,而无需更改实际HTML元素的文本内容。下表显示了不同的text-transform
值如何更改示例文本“转换我”。 值 | 结果 |
---|---|
lowercase | “改变我” |
uppercase | “改变我” |
capitalize | “改变我” |
initial | 使用默认值 |
inherit | 使用父元素的text-transform 值 |
none | 默认值:使用原始文本 |
text-transform
属性将h4
的text-transform
为大写。 h4
文本应为大写。
testString: 'assert($("h4").css("text-transform") === "uppercase", "The h4
text should be uppercase.");'
- text: 不应更改h4的原始文本。
testString: 'assert(($("h4").text() !== $("h4").text().toUpperCase()), "The original text of the h4 should not be changed.");'
```
Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.