dcsimg
 

Capitalize the First Letter of Every Word with CSS

Friday Dec 14th 2018 by Srinath MS

Language: Web, Expertise: Intermediate - Learn how to use the text-transform property in CSS to capitalize the first letter of every word.

Use the text-transform property with 'capitalize' value to capitalize the first letter of the words in an element.,

For example:

div { text-transform: capitalize; }
<div>this is a statement that requires first letter to be capitalized </div>

would become:

<div>This Is A Statement That Requires First Letter To Be Capitalized </div>
Home
Mobile Site | Full Site