Metin dönüştürmeleri için CSS ile yapabileceğiniz birkaç şey var, hepsi burada.
.Capitalize
{ text-transform: capitalize }
.Uppercase
{ text-transform: uppercase }
.Lowercase
{ text-transform: lowercase }
.Nothing
{ text-transform: none }
Maalesef text-transform hiçbir Deve Vaka yoktur.
Metni uygun şekilde dönüştürmek için Javascript'i kullanabilir ya da PHP veya ASP gibi bir kodlama dili kullanıyorsanız, o zaman orada değiştirin. bunun yerine css ile dönüşüm geliyor gibi metin biçimlendirme, bu yolu gidiş sonunda zorunda gidiyorum
function strtocamel($str, $capitalizeFirst = true, $allowed = 'A-Za-z0-9') {
return preg_replace(
array(
'/([A-Z][a-z])/e', // all occurances of caps followed by lowers
'/([a-zA-Z])([a-zA-Z]*)/e', // all occurances of words w/ first char captured separately
'/[^'.$allowed.']+/e', // all non allowed chars (non alpha numerics, by default)
'/^([a-zA-Z])/e' // first alpha char
),
array(
'" ".$1', // add spaces
'strtoupper("$1").strtolower("$2")', // capitalize first, lower the rest
'', // delete undesired chars
'strto'.($capitalizeFirst ? 'upper' : 'lower').'("$1")' // force first char to upper or lower
),
$str
);
}
:
İşte strtoupper PHP doc sayfasından alınmış bir örnek. –
Yardım almaktan memnun oldum. :) – David