@Evavic44
Posted
There are several ways in doing that, all depends on the use case.
div { margin: 0 auto; }
div { position: relative; top: 50%; left: 50%; }
3 Or use a transform property div { transform: translate(50vw, 50vh); }
@abubakarMana01
Posted
@Evavic44 You should also be aware that the div has to have width and height set if you're to use {margin: auto}. The parent container in this case I believe should be the body also needs to have a height so you can centralize vertically as well. Happy coding!!!😁