letter-spacingプロパティ

TOPページに戻る > CSS

スポンサード リンク

letter-spacingプロパティ

文字の間隔を指定できます
1emで1文字間隔が広がります。0.5emで半文字分広がります

使い方(書式)

セレクタ { letter-spacing: 値; }                                    

letter-spacingプロパティ

対応ブラウザ ie6 ie7 ie8 ie9 ie10 ie11 google Chrome safari fire fox opera
適用できる要素 全てのhtml要素
子要素へのスタイルの継承 する

プロパティの値 説明
単位 px、emなどの単位で指定
normal 通常の文字間隔

実際の指定方法

.hoge { letter-spacing: 1em; }     /* 文字の間を1文字分の間隔に広げる */

.hoge2 { letter-spacing: 0.5em; }   /* 文字の間を文字の半分の間隔に広げる */

.hoge3 { letter-spacing: 5px; }     /* 文字の間を5px文字間隔に広げる */
.hoge4 { letter-spacing: normal; }  /* 通常の文字間隔 */

html部分

<p class="hoge">文字の間隔1em</p>
<p class="hoge2">文字の間隔0.5em</p>
<p class="hoge3">文字の間隔5px</p>
<p class="hoge4">文字の間隔normal</p>

実際の表示

文字の間隔1em

文字の間隔0.5em

文字の間隔5px

文字の間隔normal





(C)2012 ホームページ作成無料