center and scale an element to fill its parent