使用 CSS 进行文本转换
cssweb developmentfront end technology更新于 2024/11/5 6:04:17
对于 CSS 中的文本转换,请使用 text-transform 属性,其值如下 −
text-transform: none|capitalize|uppercase|lowercase|initial|inherit;
示例
<!DOCTYPE html>
<html>
<head>
<style>
div {
line-height: 1.9;
text-transform: uppercase;
}
</style>
</head>
<body>
<h1>Demo Heading</h1>
<div>
<p>This is demo text.<br>
This is another demo text.
</p>
</div>
</body>
</html>
输出

示例
让我们看另一个例子 −
<!DOCTYPE html>
<html>
<head>
<style>
div {
text-transform: lowercase;
}
</style>
</head>
<body>
<h1>Demo Heading</h1>
<div>
<p>THIS is demo text.<br>
This is ANOTHER demo text.
</p>
</div>
</body>
</html>
输出

相关文章
有用资源
css 参考教程 - 该教程包含有关 css 的更多信息:https://www.cainiaomax.com/css/

