Anchor tag links not working properly

Geplaatst op 3 maart 2017 door Gerdt Brouwer

If your website has a fixed header you may have noticed that anchor tag links don’t work perfectly. This happened to me also but thanks to Adrian Gordon I finally figured out why and how to fix it.
When you use a fixed header you have to add the following to your css :

:target:before {
content:"";
display:block;
height:90px; /* fixed header height*/
margin:-90px 0 0; /* negative fixed header height */
}

I only added this here for me to remember, all credits go to Adrian from itsupportguides
They saved my day.

Gepost in categorie: TechTalk

Reacties

Plaats reactie zonder facebook account

Anoniem