calculate height and width for content section