CSS无法做到这一点,您可以为此使用PHP或Javascript。
PHP示例:
$text = "ALL CAPS";
$text = ucwords(strtolower($text)); // All Caps
jQuery示例(现在是插件!):
// Uppercase every first letter of a word
jQuery.fn.ucwords = function() {
return this.each(function(){
var val = $(this).text(), newVal = '';
val = val.split(' ');
for(var c=0; c < val.length; c++) {
newVal += val[c].substring(0,1).toUpperCase() + val[c].substring(1,val[c].length) + (c+1==val.length ? '' : ' ');
}
$(this).text(newVal);
});
}
$('a.link').ucwords();
最后
以上就是幸福西装最近收集整理的关于html文本大小写转换,CSS文字转换大写的全部内容,更多相关html文本大小写转换内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复