The text processing attribute of a style sheet has two important attributes: writing-mode and text-align. Let's first look at their usage:
1. writing-mode (set the object writing direction)
Syntax: writing-mode: lr-tb, tb-rl
Parameter: lr-tb: from left to right, from top to bottom tb-rl: from top to bottom, from right to left
Example: div {writing-mode: tb-rl ;}
2. text-align (set the alignment of text in the object)
Syntax: text-align: left, right, center, and justify
Parameter: left alignment right: right alignment center: center justify: both ends alignment
Example: div {text-align: center ;}
Next, let's create an instance with a tight schedule:
The code is as follows: |
Copy code |
<Html> <Head> <Title> vertical text </title> <Style type = "text/css"> <! -- . Tnt {Writing-mode: tb-rl; Text-align: left; font-size: 9pt} --> </Style> </Head> <Body> <Div class = "tnt"> Indeed, it is very easy to implement the vertical layout of text processing office software. This problem is rarely discussed in the production of web pages. However, when creating websites with ancient Chinese characteristics, such as text history, calligraphy, scenic spots and historical sites, if you use vertical lines of text, with an antique background and a simple old color, visually unexpected results are achieved. </Div> </Body> </Html> <Html> <Head> <Title> vertical text </title> <Style type = "text/css"> <! -- . Tnt {Writing-mode: tb-rl; Text-align: left; font-size: 9pt} --> </Style> </Head> <Body> <Div class = "tnt"> Indeed, it is very easy to implement the vertical layout of text processing office software. This problem is rarely discussed in the production of web pages. However, when creating websites with ancient Chinese characteristics, such as text history, calligraphy, scenic spots and historical sites, if you use vertical lines of text, with an antique background and a simple old color, visually unexpected results are achieved. </Div> </Body> </Html>
|
[Ctrl + A Select All tips: You can modify some code and then press run]