Sticky Header Header

I have a sticky headline that floats over the rest of the page. When I snap to the page anchor, these are, of course, scrolls, so the anchor is at the top of the page. However, when this happens, the title closes the text below.

Can this be fixed? I can’t just move the anchor, because there are a lot of them on the page, and each of them has the following text. My first, although it was somehow scroll to a certain height above the anchor.

Thanks David

+5
source share
2 answers

The: target pseudo-element may be what you are looking for. With: target, you can refer to the element specified in the # -mark. Read more about it here.

+3
source

, :

A.named:target {
    display: inline-block;
    height: 120px;
    margin-top: -120px;
}

"named" , , . 120px , - 80 , 40 , H2, ... , , , .

, !

0

All Articles