Single-Line Text Justification and Full-Width Alignment with CSS Only
I’ll introduce how to achieve single-line text justification and full-width alignment using only HTML and CSS web technologies.
The completed result of single-line text justification and full-width alignment using only HTML and CSS looks like this:
⭐ https://codenote-net.github.io/sandbox/justify/index.html
CSS
.justify {
display: flex;
justify-content: space-between;
}
HTML
<div class="justify">
<span>均</span>
<span>等</span>
<span>割</span>
<span>付</span>
</div>
<div class="justify">
<span>両</span>
<span>端</span>
<span>ぞ</span>
<span>ろ</span>
<span>え</span>
</div>
The sample code is published in the following GitHub Pull Request, so please take a look.
⭐ CSS だけで1行の均等割付、両端揃え · Pull Request #4 · codenote-net/sandbox
That’s all from the Gemba where I achieved single-line text justification and full-width alignment using only HTML and CSS.