Text-align Summary description of CSS common text attributes

Source: Internet
Author: User
This article describes the text-align summary of CSS common text properties

The Text-indent attribute is mentioned earlier to implement indentation of text, and today's text-align usage is much higher than text indentation. For the project you are doing now, the horizontal and vertical centers are estimated to be the most used, so let's take a look at its syntax first.

Text-align

Allowable value left| Center | Right | Justify |

The initial value is related to the user agent

Can inheritance be

Applies to block-level elements

Text-align is another attribute that only adapts to block-level elements, and if you want to center a link or picture in a row, regardless of the alignment of the rest of the line. Let's go through the whole
Feel the effect of the text-align.

This is Text-align's four attribute value display picture

The above display is very intuitive to show the Text-align property rules, for the last attribute text-align:justify in each browser performance is not very consistent, personal feeling so jusity application scenario is not too much,

Application Scenarios:

1. Text alignment: This looks at the UI diagram is how the design situation, a word, according to the design of the line.

2. Center alignment of the image: We have no effect on IMG using Text-align, and remember that text-align can only be used for block-level elements, not for inline elements and non-replacement elements. So we need to change the center of the picture.

Scenario: <div style= "Text-align:center" ></div>

The superficial discussion about the text-align is here, we have to try more.

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.