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

[新着] Webテンプレートを仮オープンしました


text-transform: ***;

ブラウザ
Internet Explorer Netscape6 Firefox Opera
参考
書式基本 要素名 クラス ID

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


p {
text-transform: capitalize;
}


text-transform capitalize … (単語の先頭文字を大文字に変換)
uppercase … (すべてを大文字に変換)
lowercase … (すべてを小文字に変換)
none … (指定なし)デフォルト

使用例

<html>
<head>
<title>TAG index Webサイト</title>

<style type="text/css">
<!--

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


-->
</style>

</head>
<body>

<p>this is a pen</p>
<p id="example1">this is a pen</p>
<p id="example2">this is a pen</p>
<p id="example3">THIS IS A PEN</p>

</body>
</html>

これをブラウザで見ると次のように表示されます

this is a pen

this is a pen

this is a pen

THIS IS A PEN



[特集] レンタルサーバー比較 & サーバー選びのチェックポイント

サイト内検索について - ベーシック版