Rearranging dom for tablet and mobile layout