A simple way of using CSS to implement vertical lines of text

Source: Internet
Author: User

There are two important attributes in the style sheet's word processing properties: 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:

CSS code copy content to clipboard

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:

CSS code copy content to clipboard

div {text-align:center;}

And usually the general layout of the idea: the width of the text object can only line the width of the next text, so that lines of text line up to two words to automatically wrap the text, the formation of the need to erect typesetting.

 CSS Code copy content to clipboard

  1. <! DOCTYPE html>
  2. <meta http-equiv="Content-type" Content="text/html; charset=gb2312 " />
  3. <title> Vertical Typesetting Example online demo www.jb51.net</title>
  4. <style>
  5. body{text-align:Center}
  6. . shuli{ margin: 0 Auto; width:20px; line-height:24px; border:1px solid #333}
  7. </style>
  8. <body>
  9. <div class="Shuli"> I am a vertical typesetting </div>
  10. </body>

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.