Button scrolls to far down

Hello all.

I have an issue with a button that scrolls to far down.

I have a page and when you scroll you can see a Call To Action. Like this one :

image

This CTA send to the end of the page. So I use a link like this on my button : https://ecotech-geneve.ch/pac-test/#pg-4174-8

It works but there is an issue because it’s scrolling to far down as you can see on the image below :

It would be better to have this :

Someone could help ?

The link of the page : https://ecotech-geneve.ch/pac-test

Have a nice day. Seb :slight_smile:

Hello there,

Please try adding this CSS code to Appearance > Customize > Additional CSS from dashboard.

    #pg-4174-8 {
      scroll-margin-top: 185px;
    }

Regards,
Kharis
aThemes Support

Hello Kharis,

Thank you :slight_smile: But it doesn’t work as you can see below :

image

Hello there,

It seems likely the WordPress CSS property validation system in customizer has not yet white-listed scroll-margin-top, which is already supported by major web browsers like Firefox. Refer to this documentation for detailed information regarding this:

Regards,
Kharis
aThemes Support

As an addition, request you to check this discussion on track ticket: https://core.trac.wordpress.org/ticket/44471#comment:16. I presume that scrol-margin-top is a new property that has not been recognized yet by WordPress CSS code editor.

In my opinion, you don’t have to worry about that ‘unknown’ notice as it should work on the actual web browser.

Let me know in case of any queries you might have.

Regards,
Kharis
aThemes Support

Hello,

It’s okay. It works. Thank you :slight_smile: