at the moment i had to fix the scroll behavior on different browsers on my WP site.. works fine now for FF, Safari and Chrome.
The thing now is, that im not able to target specially the new edge browser (chromium).
here the menu with the anchor:
<li class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item menu-item-1400"><a href="https://ferevuti.myhostpoint.ch/schneideroptik/brillen/#korrekturfassungen" aria-current="page" class="elementor-sub-item elementor-item-anchor elementor-item-active">Korrekturbrillen</a></li>
and here the section where the anchor leads to:
<section class="elementor-section elementor-top-section elementor-element elementor-element-589117b elementor-reverse-mobile elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="589117b" data-element_type="section" id="korrekturfassungen">
section css simple:
.elementor-187 .elementor-element.elementor-element-589117b {
padding: 50px 0 0;
}
and the CSS im using on the page to fix the anchor scroll on all borwsers except edge canavary
/* Anweisung für Fü FireFox */
@-moz-document url-prefix() {
section
{
scroll-margin-top: 12rem !important ;
padding-top: 50px !important;
}
}
/* Anweisung für Chrome */
section
{
scroll-margin-top: 4rem;
}
/* Anweisung für Safari */
@supports (background: -webkit-canvas(squares)) {
section {
margin-top: -6em !imporatnt;
padding-top: 4em !important;
}
}
if it helps here the page https://ferevuti.myhostpoint.ch/schneideroptik/brillen/
unfotunately scroll-margin-top
behavior / position is different on Edge if i click on an anchor link then in chrome.
I tried to use
@supports (-ms-ime-align:auto) {
section
{
scroll-margin-top: 10rem;
}
}
but this is for the older browsers.
Is there a workaround to use scroll-margin-top for edge or target edge chromium directly?