introduce auto-height to calculate the height based on parent element