better way to align center

this way can align even the element is hiding