If you are using wordpress default theme twenty-twentyfour, you may counter this issue:
There is a while line below the navigation menu, here is how to get rid of it.
To remove the white line between the navigation menu and content in the Twenty Twenty-Four theme in WordPress, you can add some custom CSS. Here's how you can do it:
Step 1: Editor
Step 2: Click and Choose first block right after the header. You will see a little menu bar appear on the top left of the block.

- Then you will find in right the block space option. Change this number to 0.

- The while line will disappear as the following screenshot shows.

Or you can also give the following suggestion a try.
1 Go to the WordPress Dashboard.
2 Navigate to "Appearance" > "Customize".
3 In the Customizer, select "Additional CSS".
4 Add the following CSS code:
css
.site-header {
border-bottom: none;
}
5 Click "Publish" to apply the changes.
This CSS rule targets the .site-header element and removes any border at the bottom, which should eliminate the white line between the navigation menu and the content.
If this doesn't achieve the desired result, it might be due to other CSS rules or elements. In that case, you can inspect the element using your browser's developer tools (right-click on the line and select "Inspect") to identify the exact class or element causing the issue and adjust the CSS accordingly.
leave us a comment if it's helpful to you, or any questions so we can help you further.
I hope it's helpful to you.