Smooth scrolling

 I have been adding 'smooth scrolling' to my pages which have internal links.


I add this to my CSS:


    :root { scroll-behavior:smooth; } 


The browser now shows moving through the page to get to the link.


This even works on Firefox and on the old Chrome for Windows7.


Sometimes the page scrolls very quickly when I come 'back' to a page where I had gone to a link.


I turn 'smooth scrolling' off when the user has asked for 'reduced motion'.


I learnt about this from reading the book: 'Responsive Web Design with HTML and CSS' by Ben Frain. I found the book in a branch of my local library. I find different books in the different branches.





Comments

Popular posts from this blog

Problem with mobile testing tool

Coding in small steps can be boring