1. Home
  2. スタイルシート CSS
  3. テキスト・フォント
  4. 大文字と小文字を変換する

大文字と小文字を変換する


text-transform: ***;

ブラウザ
IE
Fx
Sf
Cr
O
特性
text-transform

text-transform は、大文字と小文字の変換を指定するプロパティです。



p {
text-transform: capitalize;
}


プロパティ名 説明
text-transform none 変換しない (初期値)
capitalize 単語の先頭文字を大文字に変換
uppercase 全ての文字を大文字に変換
lowercase 全ての文字を小文字に変換

メモ

このスタイルの指定は、大文字と小文字を持つ言語に対してのみ有効です。(日本語などの場合は効果がありません)


使用例


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>文書のタイトル</title>

<style type="text/css">

p.example1 { text-transform: capitalize; }
p.example2 { text-transform: uppercase; }
p.example3 { text-transform: lowercase; }

</style>

</head>
<body>

<p class="example1">css codes and examples</p>
<p class="example2">css codes and examples</p>
<p class="example3">CSS CODES AND EXAMPLES</p>

</body>
</html>

表示例

css codes and examples

css codes and examples

CSS CODES AND EXAMPLES


テキスト・フォント

ページの先頭へ


inserted by FC2 system