텍스트 변환을 위해 CSS로 할 수있는 몇 가지 방법이 있습니다.
.Capitalize
{ text-transform: capitalize }
.Uppercase
{ text-transform: uppercase }
.Lowercase
{ text-transform: lowercase }
.Nothing
{ text-transform: none }
불행히도 카멜 케이스 텍스트 변환이 없습니다.
항상 JavaScript를 사용하여 텍스트를 적절히 변환하거나 PHP 또는 ASP와 같은 스크립팅 언어를 사용하는 경우 JavaScript로 변경할 수 있습니다. 대신 CSS로 변환의에서 온다 내가 텍스트를 포맷,이 길을가는 결국해야 할거야
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
);
}
:
다음은 strtoupper PHP의 문서 페이지에서 촬영 한 예입니다. –
도움이된다는 기쁜 마음. :) – David