(例)【CSS】text-justifyの使用方法
See the Pen
text-justify by linlin (@linlin098765)
on CodePen.
<h5>text-justify:auto; を指定</h5>
<p class="sample" style="text-justify:auto;">
あああああああああああああああああああ
</p>
<p class="sample" style="text-justify:auto;">
There are three apples on the desk.
</p>
<h5>text-justify:none; を指定</h5>
<p class="sample" style="text-justify:none;">
あああああああああああああああああああ
</p>
<p class="sample" style="text-justify:none;">
There are three apples on the desk.
</p>
<h5>text-justify:inter-word; を指定</h5>
<p class="sample" style="text-justify:inter-word;">
あああああああああああああああああああ
</p>
<p class="sample" style="text-justify:inter-word;">
There are three apples on the desk.
</p>
<h5>text-justify:inter-character; を指定</h5>
<p class="sample" style="text-justify:inter-character;">
あああああああああああああああああああ
</p>
<p class="sample" style="text-justify:inter-character;">
There are three apples on the desk.
</p>
p.sample {
width:150px;
background-color:gray;
text-align:justify;
}
【CSS】text-justify:テキストを均等割りにする
CSSのtext-justifyは、text-align:justifyを指定した際に、均等割りの形式を指定するプロパティです。
- auto
ブラウザの仕様にお任せ - none
均等割りを無効 - inter-word
単語の区切りに合わせて均等割り - inter-character
文字同士の間隔を調整することで均等割り