可能的值
| 值 | 描述 |
|---|---|
| none | 默認。定義帶有小寫字母和大寫字母的標准的文本。 |
| capitalize | 文本中的每個單詞以大寫字母開頭。 |
| uppercase | 定義僅有大寫字母。 |
| lowercase | 定義無大寫字母,僅有小寫字母。 |
| inherit | 規定應該從父元素繼承 text-transform 屬性的值。 |
<html>
<head>
<style type="text/css">
h1 {text-transform: uppercase}
p.uppercase {text-transform: uppercase}
p.lowercase {text-transform: lowercase}
p.capitalize {text-transform: capitalize}
</style>
</head>
<body>
<h1>This Is An H1 Element</h1>
<p class="uppercase">This is some text in a paragraph.</p>
<p class="lowercase">This is some text in a paragraph.</p>
<p class="capitalize">This is some text in a paragraph.</p>
</body>
</html>
查看結果:
This Is An H1 Element
This is some text in a paragraph.
This is some text in a paragraph.
This is some text in a paragraph.
