Excessive white space about H2 titles

  • Greetings.

    Please see the link and guide how to fix the excessive white space above the headings “New Web Design”, “Website Redesign” etc.

    Ideally, for symmetry, the text and image should be all top-aligned.

    For your information, I am using a WordPress pattern on this page.

    Thank you, I look forward to a quick response.

  • Hello.

    You have this CSS here:

    h2 { font-size: 28px; font-weight: 600; margin-top: 100px; margin-bottom: 24px; }

    The space is caused by the margin-top: 100px; declaration. Once you remove that, the space will be gone.

  • That helped, thanks.

    However, on mobile, there is too much white space below the “New website design” image and above h2 “New Web Design”.

    Please help fix.

  • In this decleration:

    @media (max-width: 768px) {
        html {
            /* Increase this value until your titles clear the mobile nav perfectly */
            scroll-padding-top: 220px !important; 
    			}
        h2 {
            margin-top: 60px !important; /* Reduces the giant gap on mobile */
        }
    }

    Zero out the margin-top value in:

    h2 {
            margin-top: 60px !important; /* Reduces the giant gap on mobile */
        } 
  • That worked, many thanks.

  • No problem!

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.