Hmmm... If you want something to always be centralized, I suggest using flexbox and grid instead. Then you don't have to bother with absolute values either.
In flexbox, for instance, you can just:
display: flex;
align-items: center;
justify-content: center;
or something like that. It's just as simple using grid, too!