使用CSS将文本转换为小写


要使用CSS将文本转换为小写,我们将使用text-transform属性的小写值。

示例

在此示例中,我们正在使用**text-transform**属性,并使用p标签显示转换前后的结果。

<html>
<head>
    <style>
        #lcase{
            text-transform:lowercase;
        }
    </style>
</head>
<body>
    <h3>
        Convert Text to Lowercase with CSS
    </h3>
    <p>
        In this example we have used <strong>text-
        transform</strong> property to convert the 
        text to lowercase.
    </p>
    <hr>
    <p>This is a NORMAL text with Mixed CASes.</p>
    <h4>After Conversion to Lower Case:</h4>
    <p id="lcase">
        This is a NORMAL text with lower CASe.
    </p>
</body>
</html>

结论

要使用CSS将文本转换为小写,我们在本文中使用了**text-transform**属性。当我们仅使用CSS时,我们只有此方法可用。

更新于:2024年9月11日

3K+浏览量

开启您的职业生涯

通过完成课程获取认证

开始
广告
© . All rights reserved.