Hello !

Here It's a post about how you can Center an HTML element with CSS style.

Note :

  1. To horizontally center a block element (like <div>), use margin: auto;
  2. To just center the text inside an element, use text-align: center;
  3. To center an image, set left and right margin to auto and make it into a block element.

And for centering horizontally and vertically you can use my code where i have used Flex ( The Flexible Box Layout Module, makes it easier to design flexible responsive layout structure without using float or positioning.).

To know more about what is flex and how it is use visit W3 Flex.

Hope this will help you <3