如何在CSS中将每个单词的首字母大写? [英] How can I capitalize the first letter of each word in CSS?
本文介绍了如何在CSS中将每个单词的首字母大写?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试将每个单词的首字母大写.我确实在搜索它,但没有得到它,是否可以在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;
}
推荐答案
您可以尝试使用此功能:
You can try to use this:
p { text-transform: capitalize; }
来自文档:
文本转换
此属性控制元素文本的大写效果.
This property controls capitalization effects of an element's text.
capitalize将每个单词的第一个字符大写;其他 字符不受影响.
capitalize Puts the first character of each word in uppercase; other characters are unaffected.
这篇关于如何在CSS中将每个单词的首字母大写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文