■概要
text-align属性は、テキストの揃え位置を指定するものです。
■使用方法
#box1 { text-align: right; }
#box2 { text-align: left; }
#box3 { text-align: center; }
■例
<html>
<head>
<style>
#box1 { text-align: right; }
#box2 { text-align: left; }
#box3 { text-align: center; }
</style>
</head>
<body>
<div id=”box1″>右揃え</div>
<div id=”box2″>左揃え</div>
<div id=”box3″>中央揃え</div>
</body>
</html>
出力結果
右揃え左揃え中央揃え
当サイトは広告を含めています。広告のクリックによる収益は全て当サイトの管理、維持、コンテンツ製作に使われます。