css文本属性
句法 (Syntax)
text-transform
文字转换
: {
: {
capitalize |
大写 |
lowercase |
小写 |
none |
无 |
uppercase |
大写 |
inherit }
继承 }
;
;
描述 (Description)
This property controls if and how an element’s text content is capitalized.
此属性控制是否以及如何大写元素的文本内容。
例 (Example)
These style rules make h1
headings use only uppercase letters, while the first letter of each word in h2
headings will be uppercased:
这些样式规则使h1
标题仅使用大写字母,而h2
标题中每个单词的首字母将大写:
h1 {
text-transform: uppercase;
}
h2 {
text-transform: capitalize;
}
值 (Value)
-
capitalize
capitalize
- Transforms the first character in each word to uppercase; all other characters remain unaffected—they’re not transformed to lowercase, but will appear as written in the document
- 将每个单词的第一个字符转换为大写; 所有其他字符均不受影响-它们不会转换为小写字母,但会按照文档中的文字显示
-
lowercase
lowercase
- Transforms all characters to lowercase
- 将所有字符转换为小写
-
none
none
- Produces no capitalization effect at all
- 完全不产生大写效果
-
uppercase
uppercase
- Transforms all characters to uppercase
- 将所有字符转换为大写
css文本属性