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>