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.