Tenth Chapter CSS paragraph text

Source: Internet
Author: User

1, the horizontal alignment of the paragraph

The horizontal alignment of a paragraph in CSS is controlled by the property text-align, and its value can be set to left, middle, right, and justified.

p{Font-size:12px;} p.left{text-Align:left;} p.right{text-Align:right;} p.center{text-Align:center;} p.justify{text-align:justify;}/*Justify on both sides*/--></style>class=" Left"> This paragraph is left-aligned, text-align:left, so the text is left-aligned. <br/>The moonlight before the bed, is suspected to be ground frost. <br/> Jutou Look at the moon, bow to think home. <br/> Li Bai </p><pclass=" Right"> This paragraph is text-align:right by right-aligned, so the text is right-aligned. <br/>The moonlight before the bed, is suspected to be ground frost. <br/> Jutou Look at the moon, bow to think home. <br/> Li Bai </p><pclass="Center"> This paragraph is centered, Text-align:center, so the text is aligned in the center. <br/>The moonlight before the bed, is suspected to be ground frost. <br/> Jutou Look at the moon, bow to think home. <br/> Li Bai </p><pclass="Justify"> This paragraph is justified by text-align:justify, so the text is justified by both ends. <br/>The moonlight before the bed, is suspected to be ground frost. <br/> Jutou Look at the moon, bow to think home. <br/> Li Bai </p></body>

2, the vertical alignment of the paragraph

The vertical alignment of paragraph text in CSS is achieved through the Vertical-align property. For the text itself, this property does not work for block-level elements, such as <p> and <div> tags. But for tables, this attribute is very important.

td.top{Vertical-Align:top;} td.bottom{Vertical-Align:bottom;} td.middle{Vertical-Align:middle;} span.zs{Vertical-align:10px;} span.fs{Vertical-align:-10px;}--></style>"2"cellspacing="0"Border="1"><tr><td>"02.jpg"Border="0"></td><tdclass="Top"> Vertical alignment, top</td></tr><tr><td>"02.jpg"Border="0"></td><tdclass="Bottom"> Vertical alignment, bottom</td></tr><tr><td>"02.jpg"Border="0"></td><tdclass="Middle"> Vertical alignment,middle</td></tr></table><p> Set specific <span for alignment propertiesclass="ZS"> numeric </span>, positive </p><p> set specific <span for alignment propertiesclass="FS"> numerical </span>, negative </p></body>

Tenth Chapter CSS paragraph text

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.