Get the App
SLTechnology News&Howtos  ›  Development  › 

How does css center vertical text

Shulou Source: shulou.com Published: 2022-06-02 07:16:43 10月03日 Update

This article mainly explains "how css makes vertical text center". The explanation in the article is simple and clear, easy to learn and understand. Please follow the editor's train of thought to study and learn "how css makes vertical text center".

Method: 1, use "writing-mode" attribute to set text vertical display, syntax "text element {writing-mode:vertical-lr}"; 2, use "text-align" attribute to set vertical text center, syntax "text element {text-align:center}".

The operating environment of this tutorial: windows10 system, CSS3&&HTML5 version, Dell G3 computer.

How css centers vertical text

In css, you can use the writing-mode property to set the vertical display of the text, and you can use the text-align property to set the text center.

The writing-mode property defines how the text is arranged horizontally or vertically.

Examples are as follows:

Test. One {width:200px; height: 140px; border:1px solid # 000; writing-mode: vertical-lr; text-align:center;} study hard

Output result:

Thank you for your reading, the above is the content of "how css makes vertical text center". After the study of this article, I believe you have a deeper understanding of how css makes vertical text center, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Text attributes learning elements content grammar that is ideas situations tutorials texts articles directions methods more levels environment computers knowledge knowledge points Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Apple vpn Microsoft Shulou Technology