Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I capitalize the first letter of each word in CSS?

I am trying to capitalize the first letter of each word. I did search for it but i did not get it, is it possible in CSS?

My Code currently works for the first letter only.


HTML

<span>Some Text Value</span>

CSS

.listing-table table th:first-letter
{
    font-size: 15px;
    font-weight: bold;
}
like image 680
Syed Uzair Uddin Avatar asked Sep 10 '15 12:09

Syed Uzair Uddin


People also ask

How do you capitalize text in CSS?

To make a block of text have all capital letters, use text-transform: uppercase in your CSS selector: text-transform: uppercase; The text-transform property accepts three possible values: uppercase: Sets each word to uppercase in a text element.

How do you make each word start with a capital letter?

To use a keyboard shortcut to change between lowercase, UPPERCASE, and Capitalize Each Word, select the text and press SHIFT + F3 until the case you want is applied.

How do you capitalize the first letter of every word in HTML?

capitalize − The first letter of each word in the element's text should be capitalized. uppercase − All of the characters in the element's text should be uppercase (capital letters). lowercase − All of the characters in the element's text should be lowercase.


1 Answers

You can try to use this:

p { text-transform: capitalize; }

From the docs:

text-transform

This property controls capitalization effects of an element's text.

capitalize Puts the first character of each word in uppercase; other characters are unaffected.

like image 150
Rahul Tripathi Avatar answered Oct 12 '22 01:10

Rahul Tripathi