Result jQuery$(document).ready(function() { //ハッシュリンクのアンカータグをクリックするとマッチするidを持つ要素にスクロールする $('a[href^="#"]').click(function(event) { var id = $(this).attr("href"); var offset = 60; var target = $(id).offset().top - offset; $('html, body').animate({scrollTop:target}, 500); event.preventDefault(); return false; }); });html<div class="navigation"> <a href="#html">HTML</a> <a href="#css">CSS</a> <a href
![シンプルなページ内スクロール](https://cdn-ak-scissors.b.st-hatena.com/image/square/b6b1c87ada2ad66409793e3653c810e333009609/height=288;version=1;width=512/http%3A%2F%2Fkachibito.net%2Fwp-content%2Fuploads%2F2019%2F12%2Fsite-icon.png)