Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Selected Reading
Convert text to lowercase with CSS
To convert text to lowercase with CSS, we will be using the lowercase value of text-transform property.
Syntax
selector {
text-transform: lowercase;
}
Example
In this example, we are using text-transform property and displaying the result as before and after the conversion using p tag.
<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>
Output
The text "This is a NORMAL text with lower CASe." will be displayed as "this is a normal text with lower case." in the browser.
Key Points
The text-transform: lowercase property:
- Converts all uppercase letters to lowercase
- Leaves lowercase letters unchanged
- Does not affect numbers or special characters
- Only changes the visual display, not the actual HTML content
Conclusion
The text-transform: lowercase property provides a simple way to convert text to lowercase using only CSS. This method changes the visual appearance without modifying the original HTML content.
Advertisements
