How to convert UPPERCASE letter to lowercase and first letter Uppercase for each sentences like below only by using CSS?
From: THIS IS AN EXAMPLE SENTENCE.
To: This is an example sentence.
Update: When I'm using text-transform: capitalize; The result still same.
You can capitalize the first letter of the . qcont element by using the pseudo-element :first-letter . This is the closest you're gonna get using only css. You could use javascript (in combination with jQuery) to wrap each letter which comes after a period (or comma, like you wish) in a span .
You can achieve CSS all caps by using the keyword “capitalize.” In addition, text-transform capitalize converts all the first letters in all words to uppercase. Other values you can use with text-transform include “none,” “lowercase,” “full-width,” and “full-size-kana.”
The text-transform CSS property specifies how to capitalize an element's text. It can be used to make text appear in all-uppercase or all-lowercase, or with each word capitalized.
There is no sentence caps option in CSS. The other answers suggesting text-transform: capitalize
are incorrect as that option capitalizes each word.
Here's a crude way to accomplish it if you only want the first letter of each element to be uppercase, but it's definitely nowhere near actual sentence caps:
p { text-transform: lowercase; } p:first-letter { text-transform: uppercase; }
<p>THIS IS AN EXAMPLE SENTENCE.</p> <p>THIS IS ANOTHER EXAMPLE SENTENCE. AND THIS IS ANOTHER, BUT IT WILL BE ENTIRELY LOWERCASE.</p>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With