How to align CSS at both ends and align Div + CSS at both ends

Source: Internet
Author: User

How does CSS align the two ends of a line of text? Text-align: justify;. Text-justify Syntax: Text-justify: auto | inter-word | newspaper | distriify | distribute-all-lines | inter-ideograph
Parameters:
Auto: allows the browser user agent to determine the two-end alignment rules used
Inter-word: Align text by adding spaces between words. This behavior is the fastest way to align all text rows. The alignment at both ends of the paragraph is invalid for the last line of the paragraph.
Newspaper: Align text by adding or removing spaces between words or letters. Is the most precise format used for alignment at both ends of the Latin alphabet
Distribute: Processing spaces is similar to newspaper. It is applicable to East Asian documents. Especially Thailand
Distribute-all-lines: the two ends are in the same way as distribute, and they do not contain the last line of the two section alignment. Applies to ideographic documents
Inter-ideograph: provides full two-end alignment for ideographic text. He adds or removes spaces between ideographic words and words.
Note:
Sets or retrieves the alignment of text in an object.
The script feature is textjustify.
------------ Code instance -----------
<Style>
. W1 {width: 500px ;}
. A1 {Background: #00ff00; text-align: justify; text-justify: Inter-ideograph ;}
. A2 {Background: # FFFF00 ;}
</Style>

<P> original effect: </P>
<Div class = "W1 A2"> in the pediatric Eye Clinic in the past two years, eye trauma, amblyopia, and strabismus have become the three most difficult problems. The epidemiological investigation of eye trauma in China shows that eye trauma is the primary cause of blindness in children. China's Children's eye trauma accounts for about 25% of total trauma, and the cause is as high as 60% ~ 70%.
</Div>

<P> production effect after the two ends are aligned: </P>
<Div class = "W1 A1">
Eye trauma, amblyopia, and strabismus have become the three most difficult problems in children's eye clinics in the past two years. The epidemiological investigation of eye trauma in China shows that eye trauma is the primary cause of blindness in children. China's Children's eye trauma accounts for about 25% of total trauma, and the cause is as high as 60% ~ 70%.

</Div>

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.