CSS, Web, Web Development, Layout.
<!-- HTML --> <div class="flex__container"> <div class="flex__item"></div> </div> /* CSS */ .flex__container { display: flex; // 或inline-flex justify-content: center; } .flex__item { align-self: center; } The effect is as follows: If there are multiple Flex projects in the Flex container, this