3.3 CSS文本转换(大小写字母)
来源:网络作者:站长
text-transform 属性控制文本的大小写。
| 值 | 描述 |
|---|---|
| none | 默认。定义带有小写字母和大写字母的标准的文本。 |
| capitalize | 文本中的每个单词以大写字母开头。 |
| uppercase | 定义仅有大写字母。 |
| lowercase | 定义无大写字母,仅有小写字母。 |
举例:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>3.3 CSS文本转换(大小写字母)</title>
</head>
<style>
.capitalize {
text-transform: capitalize;
/*每个单词的首字母为大写*/
}
.uppercase {
text-transform: uppercase;
/*大写字母*/
}
.lowercase {
text-transform: lowercase;
/*小写字母*/
}
</style>
<body>
<p class="capitalize">That man is the richest whose pleasure are the cheapest.</p>
<p class="uppercase">Will, work and wait are the pyramidal cornerstones for success.</p>
<p class="lowercase">All the splendor in the world is not worth a good friend.</p>
</body>
</html>
运行后如图:

你觉得文章内容怎么样
时光之美
致我未来的女友
第一次就随便写点东西
归寻