3 回答

TA貢獻2003條經(jīng)驗 獲得超2個贊
CSS無法做到這一點,您可以為此使用PHP或Javascript。
PHP示例:
$text = "ALL CAPS";
$text = ucwords(strtolower($text)); // All Caps
jQuery示例(現(xiàn)在是插件!):
// 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();

TA貢獻1942條經(jīng)驗 獲得超3個贊
您幾乎可以做到:
.link { text-transform: lowercase; }
.link:first-letter { text-transform: uppercase; }
它將為您提供輸出:
Small caps
All caps
添加回答
舉報