CSS, Web, Web Development, Layout.
method is also effective. .flex__container { display: flex; // 或inline-flex justify-content: center; } .flex__container > * { align-self: center; } For example, the following effect: In addition, you can use place-content: center to center your Flex project horizontally and vertically: