Remove Gap At Top

  • Unknown's avatar

    Hi there!
    I’m trying to have my hero image sit just underneath the navigation bar I have at the top. There’s this huge gap where normally you’d type “Title.” I don’t want to use that space, and I want the image to sit just underneath. Any thoughts? I’m guessing I need to do this in CCS/HTML, but I don’t know anything about CCS/HTML. Any thoughts on what I should type and where I should type it?

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar
  • Unknown's avatar

    AAAAND! I also wanna keep the page name in the menu, but not show “Writing Portfolio” up at the top.

  • Hi there,

    I’m trying to have my hero image sit just underneath the navigation bar I have at the top. There’s this huge gap where normally you’d type “Title.” I don’t want to use that space, and I want the image to sit just underneath.

    This code should do the trick:

    /* remove page title and spaces block */
    div.wp-container-61763ead672f8.wp-block-group, div.wp-container-61763ead672f8.wp-block-group + .wp-block-spacer {
    	display: none;
    }
    
    /* Reduce space below menu bar*/
    header.wp-container-61763ead66ea4.wp-block-group.site-header {
      padding-bottom: 30px !important;
    }

    Please do give a title to that page. Even if you don’t want it to be visible, the title is important for SEO purposes – it’s used by search engines to index the page – and it’s also used by screen readers for people with visual disabilities.

    The CSS I gave above will hide the title from being visible.

    The section that reduces the space below the menu will apply to all pages on the site. You can play around with the 30px value to make it look the way you want.

    I also wanna keep the page name in the menu, but not show “Writing Portfolio” up at the top.

    You don’t appear to have a title set on that page either at the moment. To have a title set, but hide it on that page, you can use this:

    /* Hide title on the Writing Portfolio page */
    div.wp-container-6176418d64f28.wp-block-group, div.wp-container-6176418d64f28.wp-block-group + .wp-block-spacer {
    	display: none;
    }
  • Unknown's avatar

    Hi there,
    Thanks so much for this info. I’m trying to copy and paste this in there. I’ve added the title. But where do I put this code? I go to the page edit and then click the elipses then click code editor then copy the code you put in above and paste it to the top. Is that wrong? Where exactly should I put it?

  • Unknown's avatar

    To access the CSS editor, go to My Site → Appearance → Customize → Additional CSS.

    You can read more about how to add CSS code here:

    https://wordpress.com/support/editing-css/

  • Unknown's avatar

    Man… I tried copy/pasting the two pieces of code you shared, @kokkieh, and it didn’t work… Any other thoughts? Do I need to add to the code?

  • Hi there,

    CSS override codes like this go in the CSS tab of your customizer, below any existing code you have there:

    Click to view image

    Did you happen to add the code somewhere else instead? If so it would not work there so you can safely remove it and instead add the code in the site customizer, as helper-heroponriki has pointed out.

    Once it’s added let us know and we can take a closer look, thanks!

  • The topic ‘Remove Gap At Top’ is closed to new replies.