apply a natural box layout model to all elements