React - Center a component horizontally and vertically

added by JavaScript Kicks
9/14/2022 3:09:18 PM

851 Views

In this tutorial, we are going to learn about how to center a component horizontally and vertically in React with the help of examples. Consider, we have the following component in our react app: To center a component horizontally and vertically in React, add the display:flex, justify-content: center and align-items: center to the react component CSS class.


0 comments