Sites Web : One line CSS solution to prevent anchor links from scrolling behind a sticky or fixed header - La veille technologique de Pyrat.net

Publié le lundi 27 juin 2005

⇒ https://veille.pyrat.net/

La création de site web implique de se tenir à jour et au courant des évolutions techniques.

Vous retrouverez ici les pages que nous avons visitées et dont nous avons estimées digne d’intérêt.

Il n’y a d’ailleurs pas que de la technique…

One line CSS solution to prevent anchor links from scrolling behind a sticky or fixed header

Septembre 2023, Par Veille pyrat.net

The scroll-padding-top property
The scroll-padding-top property is applied to the parent container and acts just like a CSS top padding, defining offsets from the top of the scrolling area.

scroll-padding-top : <value> ;
Copy
You can use any px, em, rem, vh, %, etc. value, as well as auto, where the user agent determines the offset as 0px.

Permalien

→ Lire la suite sur le site d’origine…


Revenir en haut