Summary of common css attributes: text-align and csstext-align in text attributes
As mentioned above, the text-indent attribute is used to indent text. Today's text-align usage is much higher than text indent. For the current project, it is estimated that horizontal and vertical center are the most used. Let's look at its syntax first!
Text-align
Allowed value: left | center | right | justify |
The initial value is related to the user agent.
Can it be inherited?
Applicable to block-level elements
Text-align is another attribute that only adapts to block-level elements. If you want to center a link or image in a row, no matter the alignment of the remaining part of the row, it won't work. First, let's use the overall
Feel the text-align effect.
Here is the four attribute values of text-align.
The above display intuitively shows the property rules of text-align. The last property text-align: justify is not consistent in each browser, I personally think there are not many jusity application scenarios,
Application scenarios:
1. Text alignment: It depends on how the UI diagram is designed. In one sentence, you can design it as needed.
2. align the image in the center: it is ineffective to use text-align for img separately. Do not forget that text-align can only be used for block-level elements, but not for intra-row and non-replacement elements. So we need to modify the image center.
Solution: <div style = "text-align: center"> </div>
The Rough Discussion of text-align is here. You can try it more by yourself.