Align CSS text on both sides

Source: Internet
Author: User

When making a form, we often encounter situations where the top and bottom two fields are aligned, such as name, cell phone number, and place of birth. So we'll have to use text-align, text-justify style.

Text-align directly set to justify on the line, text-justify the situation is complicated, maybe someone is not familiar with it. The values of IE are as follows:

    • Auto: Allows the browser user agent to determine the justification used
    • Inter-word: Aligns the text by increasing the space between the words. This behavior is the quickest way to align all lines of text. Its justification behavior is not valid for the last line of a paragraph
    • Newspaper: aligns text by increasing or decreasing the spacing between words or letters. is the most precise format for the Latin alphabet justification
    • Distribute: Handling whitespace is much like newspaper, which works for East Asian documents. Especially Thailand.
    • Distribute-all-lines: Both ends of the hyphenation are the same way as distribute and do not contain the last line of two paragraphs aligned. Applies to ideographic documents
    • Inter-ideograph: Provides full justification for ideographic text. He increases or decreases the space between ideographic words and words

But it was originally implemented as a private implementation of IE, such as text-overflow, overflow-x, etc., at FF very late, in other words there are strict compatibility issues. and ff,chrome need to manually insert blank or soft line labels between Chinese characters to take effect, and the resistance in chrome is even greater. P>

1 . Test1{2 text-align:Justify;3 text-justify:Distribute-all-lines;/*ie6-8*/4 Text-align-last:Justify;/*IE9*/5 -moz-text-align-last:Justify;/*FF*/6 -webkit-text-align-last:Justify;/*Chrome 20+*/7}8 @media screen and (-webkit-min-device-pixel-ratio:0){/*Chrome*/9 . Test1:after{Ten content: "."; One Display:Inline-block; A width:100%; - Overflow:Hidden; - Height:0; the} -             }

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.