Viewing 6 replies - 1 through 6 (of 6 total)
  • Theme Author Stefan Brechbuehl

    (@pixelstrolch)

    I believe your screenshot shows a h3 title at the beginning of the post. Remove the margin-top from the first title and you’ll get less space.

    .entry-content h3:first-child {
       margin-top: 0;
    }

    If this is still not enough, you need to change the margin of #content.

    Cheers Stefan

    Thread Starter darristan

    (@darristan)

    Hi. Thanks for the reply. I tried to change the following but don’t see any effect.

    #content {
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    }

    or

    .entry-content h3:first-child {
    margin-top: 0;
    }

    Thanks in advance

    Theme Author Stefan Brechbuehl

    (@pixelstrolch)

    Hi darristan,

    I tested removing margin-top from .entry-content>h3:first-child. That worked. The usual space above the first h3 title was removed. I’m not sure if the title on your screenshot is a h3 title. However you should add the page id to that css rule, otherwise you’ll affect the whole website.

    If you wanna change the margin of #content you have to consider the media queries. If you add a new css rule like

    #content {
    margin-top: 1.5em;
    }

    you will only change something on small screens.

    For bigger screens you need

    @media screen and (min-width: 768px) {
       #content {
          ...
       }
    }

    Cheers Stefan

    Thread Starter darristan

    (@darristan)

    Again, thanks for your patience. Yes, it is a H3 title that I’m asking. I could not find any .entry-content>h3:first-child in the default CSS at all.

    May you please check.
    https://pastebin.com/BXiVdp7S

    Thanks.

    Hi,

    I believe the theme author means to tell you to add that line to the bottom of your main theme’s CSS or your child-theme’s CSS; or if you have the official WordPress Jetpack installed, you can go to Appearance –> Edit CSS and add it there.

    With CSS, generally whatever you write at the bottom will overwrite whatever you wrote above (unless it is declared as !important).

    Nhat

    Theme Author Stefan Brechbuehl

    (@pixelstrolch)

    Hi Nath, you got me. Thanks you made that clear.
    Cheers Stefan

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Title to content margin’ is closed to new replies.