control an element tobe center and middle