Try using the following CSS code:
#container {
display : flex;
align-items: center;
justify-content: center;
}
If this doesn't work, attempt to specify width and height for the box to be centered within its parent container based on the parent's size.
For instance, if the parent container is 100% of the width and the box is 30%, you can use the following CSS code:
margin-left : 35% ;
Repeat this process for setting the height and providing a margin-top as necessary. Hopefully, this method will assist in solving your issue. If not, I apologize for any inconvenience.