text-alignのレンダリング

 
テキスト
ホーム > CSS2 Note > text-align > text-alignのレンダリング

左・中央・右揃え

<style type="text/css"><!--
.eg1 {text-align:left;}
.eg2 {text-align:center;}
.eg3 {text-align:right;}
--></style>

<div class="eg1">こんにちは</div>
<div class="eg2">こんにちは</div>
<div class="eg3">こんにちは</div>
 

両端揃え(複数行テキスト)

<style type="text/css"><!--
.eg1 {text-align:justify;}
--></style>

<div class="eg1">
Tobacco is the second major cause of death in the world. It is currently responsible for the death of one in ten adults worldwide (about 5 million deaths each year). If current smoking patterns continue, it will cause some 10 million deaths each year by 2020. Half the people that smoke today -that is about 650 million people- will eventually be killed by tobacco.
</div>
 

文字列揃え

<style type="text/css"><!--
.eg1 {text-align:".";}
--></style>

<table border="1" class="eg1">
<tbody>
<tr><td>1.4142135623730950488016887242097</td></tr>
<tr><td>1.7320508075688772935274463415059</td></tr>
<tr><td>10.0</td></tr>
<tr><td>10000.0</td></tr>
</tbody>
</table>
2009/06/01現在、対応しているブラウザはありません。
 
関連項目: text-align
トップページ CSS2 Note ページトップ
 2009/06/01発行 2009/06/01更新