I'm experimenting with some transforms and animations using Velocity.js. One of the animations scales an element that's been absolutely positioned, but for some reason, I can't get the element to center.
According to Firefox Developer Edition's devtools, there's a negative position-bottom and position-right on the element, but I can't figure out where it's coming from. It's parent is static positioned and it's just a regular div with height: 100%.
Where could these be coming from?
Computed styles for div in question (while it's being scaled):
background-color: rgb(0, 0, 0);
border-bottom-left-radius: 50%;
border-bottom-right-radius: 50%;
border-top-left-radius: 50%;
border-top-right-radius: 50%;
box-sizing: border-box;
color: rgb(9, 29, 35);
font-family: "PT Sans", sans-serif;
font-size: 16px;
height: 2139.52px;
left: 0px;
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
position: absolute;
top: 0px;
transform: matrix(0.00870397, 0, 0, 0.00870397, 0, 0);
width: 2139.52px;
and computed styles for parent div:
box-sizing: border-box;
color: rgb(9, 29, 35);
font-family: "PT Sans", sans-serif;
font-size: 16px;
height: 944px;
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
transform: matrix(1, 0, 0, 1, 0, 0);
width: 1920px;
Here's a jsbin for reference. The big black square should be centered, but it's not for some reason.

To answer your question's title :
position-bottomdenotes the distance in pixels between the current element and its immediately positioned parent (in this case the body tag becomes the parent as no previous parent of the black-box is positioned i.e. all are positioned static [by default]).Why the negative value though? shouldn't the distance be positive? given the dimensions of the black box is less than that of the parent?
It should be normally, but you have created a box that is bigger than the parent element and have scaled it down using transform properties. So when left = 0 and top = 0, the super big unscaled child is being positioned, not the scaled down version.
I will explain the math of the negative bottom position:
Solution :
Note: