The strange technique of CSS: control the vertical line of text

Source: Internet
Author: User
css| Tips | There are two important properties in the text processing attribute of the control style sheet: Writing-mode and text-align. Let's take a look at their usage first:

1. Writing-mode (Set object writing direction)

Syntax: WRITING-MODE:LR-TB, TB-RL
Parameters: Lr-tb: From left to right, from top down TB-RL: From top down, right to left
Example: div {writing-mode:tb-rl;}

2. Text-align (Sets the alignment of the text in the object)

Grammar: Text-align:left, right, center, justify
Parameters: Left: right-aligned right: Align Center: center justify: Justify
Example: div {text-align:center;}

Next, let's make a tight example: < HTML >
< head >
< title > Vertical Text </title >
< style type= "Text/css" >
<!--
. TNT {WRITING-MODE:TB-RL; TEXT-ALIGN:LEFT;FONT-SIZE:9PT}
-->
</style >
< BODY >
< div class= "TNT" >
Indeed, the vertical line of presentation text is very easy to implement in word processing Office software. Since this effect is not much seen in the production of Web pages, the discussion on this issue is relatively small. But in the production of Chinese ancient characteristics of the site, such as the text history, calligraphy, tourist sites and so on site, if the use of vertical text, with the antique background and simple old colors, in the visual will get unexpected results.
</div >
</body >

<ptml> <pead> <title> Vertical text </title> <style type= "Text/css" > <!--. TNT {Writing-mode:t B-RL; TEXT-ALIGN:LEFT;FONT-SIZE:9PT}--> </style> </pead> <body> <div class= "TNT" > Indeed, in the expressive words of the Vertical in the word processing Office software is very easy to achieve. Since this effect is not much seen in the production of Web pages, the discussion on this issue is relatively small.   But in the production of Chinese ancient characteristics of the site, such as the text history, calligraphy, tourist sites and so on site, if the use of vertical text, with the antique background and simple old colors, in the visual will get unexpected results. </div> </body> </ptml>

[Ctrl + A ALL SELECT hint: You can modify some of the code, and then run]



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.