This Video shows how we can center align an element in a div using 3 methods.
1. Using position and transform property: -Make sure that the parent div in this case which is "center" has fixed height property. Then set the parent div to "position: relative;". Now the child element in this case which is "p" should have the "position: absolute;" and "transform" property.
2. Using "disply:flex" property
This is easier than position and transform property. We just need to write three lines of code in the "parent element" to center align the child element which is "p".
3. Using "disply:grid" property
This is the easiest of all which is "display:grid" property. We just need to write two lines of code in the "parent element" to center align the child element which is "p".