Hello StackExchange community, I desperately need your help.

I am trying to completely get rid of the page title and the space that occupies right before the beginning of the content. Here is what I have done:

  1. Leaving the space blanked

    Having pages without a name is not recommended. It will be hard to browse them via your dashboard. With that being said, if you leave the title field empty there is still a margin before the content.

  2. Hiding the title with CSS

    I have used the following CSS .page .entry-title{ display: none; } to globally hide page titles from pages. Even so, there is still a margin before the content. I then tried .entry-header instead of .entry-title but did not work anyway.

Inspecting the elements from my browser, I spot a style added to the element <main id="main" class="site-main" role="main"> which is surprisingly different in every browser. On Safari, for example, would be style="margin-top: 40px;" and on Chrome style="margin-top: 75px;".

When I go to the page.php and index.php files of my theme, all I find is a simple, clean <main id="main" class="site-main" role="main"> and I wonder where is this style being generated. Is it Wordpress through its functions? I also tried to override this style with adding my own style="margin-top: 0px !important;" but it didn't work.

I am currently building on Blask Theme. Does this even matter?

  • as this is a theme specific formatting question, please consider to ask in your theme's support forum or contact the developer of the theme for help. – Michael May 3 at 21:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.