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

前端 未结 3 1036
死守一世寂寞
死守一世寂寞 2021-01-14 00:01

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 lette

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-14 00:42

    The :first-letter pseudo-element targets the first letter of your element, not the first letter of each word. Besides, you're wrappring your code in a span in HTML and targetting a th in CSS, is it supposed to be like that?

    Try using this instead :

     .listing-table table th{
         text-transform: capitalize;
     }
    

    Documentation of text-transform

提交回复
热议问题