Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS Sentence Case [duplicate]

Tags:

html

css

Is there any way to format a "SENTENCE CASE"? e.g. "THIS IS SENTENCE 1. THIS IS SENTENCE 2. THIS IS SENTENCE 3. change to -> This is sentence 1. This is sentence 2. This is sentence 3.

like image 478
Lian Avatar asked Feb 18 '13 07:02

Lian


People also ask

How do I change my sentence case in CSS?

There are only three CSS properties. text-transform: capitalize; text-transform: lowercase; text-transform: uppercase; None of them is gonna output as you want. You can use lowercase text-transform and them use JavaScript to capitalize first word of each sentence.

How do you capitalize the first letter of a sentence in CSS?

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 .


1 Answers

you can use id/class:first-letter property to achieve that.

Taken from the duplicate question mentioned above:

p {
    text-transform: lowercase;
}
p:first-letter {
    text-transform: uppercase;
}
like image 106
iamshahid Avatar answered Sep 17 '22 11:09

iamshahid