Good day.
I know that if you want to absolute center a div, you do this:
blahblah
This can be done with CSS alone.
#parent { position: absolute; max-width: 500px; max-height: 500px; width: 100%; height: 100%; top: 50%; left: 50%; transform: translate(-50%, -50%); }
See demo https://jsfiddle.net/matharden/8kmvt8qd/