Any HTML item can have its Height undefined by clicking on the Height icon to the left of the Height input box in the HTML inspector.
On the FW page you will see the top and bottom centre points (grab handles) changed to red and the HTML item will collapse to the height of its content.