How can I transform a text from uppercase to capital case using CSS only?
For example change this text " THIS IS A TEXT. " to " This Is A Text. "
How can I transform a text from uppercase to capital case using CSS only?
For example change this text " THIS IS A TEXT. " to " This Is A Text. "
With the help of text-transform css property Check details here
Like this. text-transform: capitalize;
EDIT: If the text is written in uppercase then it's impossible with just css.
The text-transform property in CSS controls text case and capitalization.
.capitalize {
text-transform: capitalize;
}
"this is a text" "This Is A Text"
capitalize capitalizes the first letter of each word in the selected text.
It does not makes the remaining text lowercases , that is why "THIS IS A TEXT" will not change to "This Is A Text". For This:- You have to first lowercase the texts and then capitalize it.
capitalize only affects the first letters of words. It will not change the case of the rest of the letters in a word. For example, if you capitalize a word that's in all capital letters already, the other letters in the word won't switch to lowercase. This is nice when your text includes an acronym or abbreviation that shouldn't include any lowercase letters.