如何将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;
}
推荐答案
你可以试试用这个:
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屋!
查看全文