We can apply the following CSS code to remove the white gaps on the header and footer for this pages. I have added the post and page ID to affect only this pages. Kindly add the custom CSS to your Theme Options> Custom CSS section.