Capitalize first letter of sentences CSS

前端 未结 4 1231
面向向阳花
面向向阳花 2020-12-03 06:34

I want to capitalize the first letter of sentences, and also the first letter after commas if possible. I want to add the code in here:



        
4条回答
  •  不知归路
    2020-12-03 07:01

    text-transform:capitalize; will capitalize the first letter of a sentence, but if you want to also do it for commas you will have to write some javascript. I agree with @BoltClock, though. Why on earth would you want to capitalize after a comma?

    Edit: For the sake of readers: text-transform:capitalize; will capitalize each word of a sentence, not the first one only. You must use the :first-letter CSS selector with the above.

提交回复
热议问题