Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use CSS to realize the Vertical arrangement of characters

Shulou Source: shulou.com Published: 2022-06-01 07:37:01 10月04日 Update

This article will explain in detail how to use CSS to achieve the vertical arrangement of text. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

There are two important attributes in the stylesheet's word processing properties: writing-mode and text-align. Let's take a look at their usage first:

1.writing-mode (sets the direction of object writing)

Syntax: writing-mode:lr-tb, tb-rl

Parameter: lr-tb: left to right, top to bottom tb-rl: top to bottom, right to left

Example:

CSSCode copies content to the clipboard

Div {writing-mode:tb-rl;}

2.text-align (sets the alignment of text in an object)

Syntax: text-align:left, right, center, justify

Parameter: left: align left right: align right center: Center justify: align both ends

Example:

CSSCode copies content to the clipboard

Div {text-align:center;}

The usual typesetting idea: setting the width of the text object can only arrange the width distance of one text, so that the text line can not be filled with two text to make the text wrap automatically, which forms the demand of vertical typesetting.

CSSCode copies content to the clipboard

Online demonstration of www.divcss8.com with vertical typesetting examples

Body {text-align:center}

.shuli {margin:0auto;width:20px;line-height:24px;border:1pxsolid#333}

I am vertical typesetting.

On "how to use CSS to achieve vertical text layout" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, please share it out for more people to see.

Tags: Text content clipboard object article clip two parameters width properties more examples syntax good practical ordinary important one line both ends instance Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Redmi MariaDB Xiaomi Docker