Here’s an old bit of code that I found to position something centrally inside an element. The outer square is an example of the item that will contain the centered element. The internal square is the centered element.