Example of how CSS styles implement paragraph text justification

Source: Internet
Author: User
sometimes the text in the site is more, although the parent element set the width, but always there will be uneven on both sides of the situation, looks untidy. In fact, to achieve the end of the paragraph alignment, only need to set two CSS

Style.


. demo{       text-align:justify;       text-justify:inter-ideograph;/*ie*/}

Text-justify Basic Syntax

Grammar:

Text-justify:auto |inter-word | Newspaper | Distribute | Distribute-all-lines | Inter-ideograph


Parameters:
Auto: Allows the browser user agent to determine the justification used;
Inter-word: By increasing the spacing between words, this behavior is the quickest way to align all lines of text, and its justification behavior is not valid for the last line of the paragraph;
Newspaper: The most precise format used to justify the Latin alphabet by increasing or decreasing the spacing between words or letters;
Distribute: Handling spaces is much like newspaper, applicable to East Asian documents, especially Thailand;
Distribute-all-lines: Both ends of the hyphenation are the same way as distribute, also does not contain two paragraphs aligned to the last line of the paragraph, applicable to ideographic documents;
Inter-ideograph: Provides full justification for ideographic text. He increases or decreases the space between ideographic words and words.

The code is as follows:


<! DOCTYPE html>

The effect is as follows:

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.