Codes sent to the CSS Character Center

Asked 6 days ago, Updated 6 days ago, 1 views

align-items : center;

This one and

text-align : center;

What's the difference between you two?

css

2022-09-20 15:39

1 Answers

text-align: center; is simply "Hey! Centrally align the text contained in this element by its full width". The premise is that the element that specifies this style property is an inline block or at least a block, and only the inline elements within that element can be centered and, above all, not related to Flexbox.

align-items is a type of Flexbox specification. The premise is that the element to which you want to specify that style attribute and the element to be centralized are components of Flexbox. What is Flexbox? If you are curious about align-items, you must study on your own.After studying you will understand that text-align may be more appropriate for limited purposes.


2022-09-20 15:39

If you have any answers or tips


© 2022 pinfo. All rights reserved.