#26 : Adjusts margin size according to header/footer visibility