CSS, Web, Web Development, Layout.
.flex__container { display: flex; place-content: center; } .flex__item { align-self: center; } The effect is as follows: Or change: .flex__container { display: flex; place-content: center; place-items: center; } These two methods are also applicable to scenarios where there are multiple Flex