{"id":10134,"date":"2025-12-18T12:42:30","date_gmt":"2025-12-18T03:42:30","guid":{"rendered":"https:\/\/code-plus.jp\/gp\/?p=10134"},"modified":"2025-12-18T12:42:30","modified_gmt":"2025-12-18T03:42:30","slug":"scroll-padding-top-10134","status":"publish","type":"post","link":"https:\/\/code-plus.jp\/gp\/scroll-padding-top-10134\/","title":{"rendered":"scroll-padding-top\u306f\u30ea\u30ed\u30fc\u30c9\u6642\u306b\u30ba\u30ec\u308b\uff1fCSS\u5909\u6570\u3068JavaScript\u3067\u89e3\u6c7a\u3059\u308b\u30a2\u30f3\u30ab\u30fc\u30ea\u30f3\u30af\u8abf\u6574"},"content":{"rendered":"<p class=\"fz-ss\">\u56fa\u5b9a\u30d8\u30c3\u30c0\u30fc\u306e\u3042\u308b\u30b5\u30a4\u30c8\u3067\u30a2\u30f3\u30ab\u30fc\u30ea\u30f3\u30af\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u30b8\u30e3\u30f3\u30d7\u5148\u304c\u30d8\u30c3\u30c0\u30fc\u306e\u4e0b\u306b\u96a0\u308c\u3066\u3057\u307e\u3046\u554f\u984c\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u554f\u984c\u3092\u89e3\u6c7a\u3059\u308b\u65b9\u6cd5\u3068\u3057\u3066 <code>scroll-padding-top<\/code> \u304c\u5e83\u304f\u77e5\u3089\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u5b9f\u306f <font><b class=\"fw-600\">\u30ea\u30ed\u30fc\u30c9\u6642\u306b\u30da\u30fc\u30b8\u304c\u30ba\u30ec\u308b<\/b><\/font> \u3068\u3044\u3046\u554f\u984c\u304c\u3042\u308b\u3053\u3068\u3092\u3054\u5b58\u77e5\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p class=\"fz-ss\">\n  <font>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001<code>scroll-padding-top<\/code> \u306e\u554f\u984c\u70b9\u3068\u3001CSS\u5909\u6570<font>$\\small{\\mathrm{\u3068}}$<\/font>JavaScript\u3092\u7d44\u307f\u5408\u308f\u305b\u305f\u4ee3\u66ff\u624b\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/font>\n<\/p>\n\n<!-- \u2605\u76ee\u6b21\u30ea\u30b9\u30c8 -->\n<nav class=\"tocList mt-1.5r\" data-toc-id=\"js-tocBWGD\" style=\"height:28rem\"><\/nav>\n<nav class=\"tocBtn is-fixed\" data-toc-id=\"js-tocBWGD\"><\/nav>\n<hr class=\"separator mx-auto mt-3r\" \/>\n\n<h2 class=\"fz-xl\">scroll-padding-top\u3068\u306f<\/h2>\n<p class=\"fz-ss\"><code>scroll-padding-top<\/code> \u306f\u3001\u30b9\u30af\u30ed\u30fc\u30eb\u30b9\u30ca\u30c3\u30d7\u3084\u30a2\u30f3\u30ab\u30fc\u30ea\u30f3\u30af\u306e\u30b8\u30e3\u30f3\u30d7\u4f4d\u7f6e\u3092\u8abf\u6574\u3059\u308bCSS\u30d7\u30ed\u30d1\u30c6\u30a3\u3067\u3059\u3002<\/p>\n<pre><code class=\"language-css\">html {\n\tscroll-padding-top: 80px; \/* \u30d8\u30c3\u30c0\u30fc\u306e\u9ad8\u3055\u5206 *\/\n\tscroll-behavior: smooth;  \/* \u30b9\u30e0\u30fc\u30b9\u30b9\u30af\u30ed\u30fc\u30eb *\/\n}<\/code><\/pre>\n<p class=\"fz-ss\">\u305f\u3063\u305f\u3053\u308c\u3060\u3051\u3067\u3001\u30a2\u30f3\u30ab\u30fc\u30ea\u30f3\u30af\u306e\u30b8\u30e3\u30f3\u30d7\u5148\u304c\u30d8\u30c3\u30c0\u30fc\u306e\u9ad8\u3055\u5206\u3060\u3051\u4e0a\u306b\u30aa\u30d5\u30bb\u30c3\u30c8\u3055\u308c\u307e\u3059\u3002\u4e3b\u8981\u30d6\u30e9\u30a6\u30b6\u3067\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u304a\u308a\u3001\u975e\u5e38\u306b\u30b7\u30f3\u30d7\u30eb\u306a\u89e3\u6c7a\u7b56\u3068\u3057\u3066\u591a\u304f\u306e\u30b5\u30a4\u30c8\u3067\u63a1\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n<hr class=\"separator mx-auto mt-3r\" \/>\n\n<h2 class=\"fz-xl\">scroll-padding-top\u306e\u554f\u984c\u70b9<\/h2>\n<h3 class=\"fz-ml\">\u30ea\u30ed\u30fc\u30c9\u6642\u306b\u30da\u30fc\u30b8\u304c\u30ba\u30ec\u308b<\/h3>\n<p class=\"fz-ss\"><code>scroll-padding-top<\/code> \u3092\u8a2d\u5b9a\u3057\u305f\u30b5\u30a4\u30c8\u3067\u3001\u30d5\u30ed\u30f3\u30c8\u30da\u30fc\u30b8\uff08\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\uff09\u3092\u30ea\u30ed\u30fc\u30c9\u3059\u308b\u3068\u3001\u672c\u6765\u30da\u30fc\u30b8\u306e\u5148\u982d\u304b\u3089\u8868\u793a\u3055\u308c\u308b\u3079\u304d\u3068\u3053\u308d\u304c\u3001<code>scroll-padding-top<\/code> \u306e\u5024\u3060\u3051\u4e0b\u306b\u30ba\u30ec\u3066\u8868\u793a\u3055\u308c\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p class=\"fz-ss\">\u4f8b\u3048\u3070 <code>scroll-padding-top: 150px;<\/code> \u3068\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u5834\u5408\u3001\u30ea\u30ed\u30fc\u30c9\u3059\u308b\u3068\u30da\u30fc\u30b8\u304c150px\u5206\u4e0b\u306b\u30b9\u30af\u30ed\u30fc\u30eb\u3057\u305f\u72b6\u614b\u3067\u8868\u793a\u3055\u308c\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<h3 class=\"fz-ml\">\u306a\u305c\u30ea\u30ed\u30fc\u30c9\u6642\u306b\u30ba\u30ec\u308b\u306e\u304b<\/h3>\n<p class=\"fz-ss\">\u3053\u306e\u73fe\u8c61\u306f\u3001\u30d6\u30e9\u30a6\u30b6\u306e <b class=\"fw-600\">\u30b9\u30af\u30ed\u30fc\u30eb\u4f4d\u7f6e\u5fa9\u5143\u6a5f\u80fd\uff08Scroll Restoration\uff09<\/b> \u3068 <code>scroll-padding-top<\/code> \u304c\u7af6\u5408\u3059\u308b\u3053\u3068\u3067\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n<ol style=\"list-style-type:decimal;\" class=\"my-0.5r\">\n  <li><b class=\"fw-600\">\u30d6\u30e9\u30a6\u30b6\u306e\u30b9\u30af\u30ed\u30fc\u30eb\u5fa9\u5143\u6a5f\u80fd<\/b> : \u30d6\u30e9\u30a6\u30b6\u306f\u901a\u5e38\u3001\u30da\u30fc\u30b8\u306e\u30ea\u30ed\u30fc\u30c9\u6642\u306b\u524d\u56de\u306e\u30b9\u30af\u30ed\u30fc\u30eb\u4f4d\u7f6e\u3092\u8a18\u61b6\u3057\u3066\u5fa9\u5143\u3057\u3088\u3046\u3068\u3057\u307e\u3059<\/li>\n<\/ol>\n<ol start=\"2\" style=\"list-style-type:decimal;\" class=\"my-0.5r\">\n  <li><b class=\"fw-600\">scroll-padding-top\u306e\u9069\u7528\u30bf\u30a4\u30df\u30f3\u30b0<\/b> : CSS\u3067\u5b9a\u7fa9\u3055\u308c\u305f\u30d1\u30c7\u30a3\u30f3\u30b0\u304c\u8a08\u7b97\u306b\u53cd\u6620\u3055\u308c\u308b\u524d\u306b\u30b9\u30af\u30ed\u30fc\u30eb\u304c\u5b8c\u4e86\u3057\u3066\u3057\u307e\u3046\u3053\u3068\u304c\u3042\u308a\u307e\u3059<\/li>\n<\/ol>\n<ol start=\"3\" style=\"list-style-type:decimal;\" class=\"my-0.5r\">\n  <li><b class=\"fw-600\">\u9069\u7528\u5bfe\u8c61\u306e\u554f\u984c<\/b> : <code>scroll-padding-top<\/code> \u306f\u901a\u5e38\u3001html\u8981\u7d20\u3084body\u8981\u7d20\u3001\u3042\u308b\u3044\u306f\u30b9\u30af\u30ed\u30fc\u30eb\u30b3\u30f3\u30c6\u30ca\u81ea\u4f53\u306b\u9069\u7528\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u304c\u6b63\u3057\u304f\u9069\u7528\u3055\u308c\u3066\u3044\u306a\u3044\u3068\u3001\u521d\u56de\u306e\u30af\u30ea\u30c3\u30af\u6642\u306f\u52d5\u4f5c\u3057\u3066\u3082\u3001\u30ea\u30ed\u30fc\u30c9\u306a\u3069\u306e\u30b7\u30b9\u30c6\u30e0\u7684\u306a\u30b9\u30af\u30ed\u30fc\u30eb\u6642\u306b\u306f\u7121\u8996\u3055\u308c\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059<\/li>\n<\/ol>\n<ol start=\"4\" style=\"list-style-type:decimal;\" class=\"my-0.5r\">\n  <li><b class=\"fw-600\">\u52d5\u7684\u306a\u30b3\u30f3\u30c6\u30f3\u30c4\u306e\u8aad\u307f\u8fbc\u307f<\/b> : \u753b\u50cf\u3084Web\u30d5\u30a9\u30f3\u30c8\u3001\u3042\u308b\u3044\u306fJavaScript\u306b\u3088\u308b\u8981\u7d20\u306e\u751f\u6210\u306a\u3069\u3001\u30da\u30fc\u30b8\u306e\u9ad8\u3055\u304c\u30ea\u30ed\u30fc\u30c9\u5f8c\u306b\u52d5\u7684\u306b\u5909\u308f\u308b\u5834\u5408\u3001\u30d6\u30e9\u30a6\u30b6\u304c\u4f4d\u7f6e\u3092\u7279\u5b9a\u3057\u305f\u6642\u70b9\u3068\u6700\u7d42\u7684\u306a\u30ec\u30a4\u30a2\u30a6\u30c8\u304c\u5b8c\u6210\u3057\u305f\u6642\u70b9\u3067\u4f4d\u7f6e\u306b\u5dee\u7570\u304c\u751f\u3058\u307e\u3059<\/li>\n<\/ol>\n<p class=\"fz-ss\">\u30ea\u30ed\u30fc\u30c9\u6642\u306e\u6319\u52d5\u306f\u30d6\u30e9\u30a6\u30b6\u306e\u4ed5\u69d8\uff08Chrome, Firefox, Safari\u7b49\uff09\u306b\u3088\u3063\u3066\u5fae\u5999\u306b\u512a\u5148\u9806\u4f4d\u304c\u7570\u306a\u308b\u305f\u3081\u3001\u3059\u3079\u3066\u306e\u74b0\u5883\u3067\u5b8c\u74a7\u306b\u52d5\u4f5c\u3055\u305b\u308b\u306b\u306f\u3001\u524d\u8ff0\u306e\u3088\u3046\u306aJavaScript\u306b\u3088\u308b\u88dc\u6b63\u304c\u5fc5\u8981\u306b\u306a\u308b\u30b1\u30fc\u30b9\u304c\u4f9d\u7136\u3068\u3057\u3066\u591a\u3044\u306e\u304c\u73fe\u72b6\u3067\u3059\u3002<\/p>\n<h3 class=\"fz-ml\">JavaScript\u306b\u3088\u308b\u30b9\u30af\u30ed\u30fc\u30eb\u5236\u5fa1\u3068\u306e\u7af6\u5408<\/h3>\n<p class=\"fz-ss\"><code>scroll-padding-top<\/code> \u3084 <code>scroll-margin-top<\/code> \u306f\u3001 <b class=\"fw-600\">JavaScript\u3067\u30b9\u30af\u30ed\u30fc\u30eb\u52d5\u4f5c\u3092\u5236\u5fa1\u3057\u3066\u3044\u308b\u5834\u5408\u3001\u7121\u8996\u3055\u308c\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059<\/b> \u3002<\/p>\n<p class=\"fz-ss\">\u5177\u4f53\u7684\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b1\u30fc\u30b9\u3067\u554f\u984c\u304c\u767a\u751f\u3057\u307e\u3059\uff1a<\/p>\n<ul style=\"list-style-type:bullet;\" class=\"my-0.5r\">\n  <li><b class=\"fw-600\">jQuery\u30d7\u30e9\u30b0\u30a4\u30f3<\/b> : WordPress\u306e\u76ee\u6b21\u30d7\u30e9\u30b0\u30a4\u30f3\uff08Easy Table of Contents \u306a\u3069\uff09\u304csmooth-scroll\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408<\/li>\n  <li><b class=\"fw-600\">Next.js<\/b> : App Router\u306e <code>Link<\/code> \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3067\u30a2\u30f3\u30ab\u30fc\u30ea\u30f3\u30af\u3092\u4f7f\u7528\u3057\u305f\u5834\u5408\uff08v13.4.3\u3067\u4fee\u6b63\u6e08\u307f\uff09<\/li>\n  <li><b class=\"fw-600\">React Router<\/b> : \u540c\u69d8\u306bJavaScript\u3067\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u5236\u5fa1\u3057\u3066\u3044\u308b\u5834\u5408<\/li>\n  <li><b class=\"fw-600\">\u30ab\u30b9\u30bf\u30e0\u30b9\u30e0\u30fc\u30b9\u30b9\u30af\u30ed\u30fc\u30eb<\/b> : \u72ec\u81ea\u306eJavaScript\u3067\u30b9\u30af\u30ed\u30fc\u30eb\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u88c5\u3057\u3066\u3044\u308b\u5834\u5408<\/li>\n<\/ul>\n<p class=\"fz-ss\">\u3053\u308c\u306f\u3001JavaScript\u304c <code>window.scrollTo()<\/code> \u3084 <code>element.scrollIntoView()<\/code> \u306a\u3069\u306eAPI\u3092\u4f7f\u7528\u3057\u3066\u30b9\u30af\u30ed\u30fc\u30eb\u4f4d\u7f6e\u3092\u76f4\u63a5\u5236\u5fa1\u3059\u308b\u5834\u5408\u3001CSS\u306e <code>scroll-padding<\/code> \u30d7\u30ed\u30d1\u30c6\u30a3\u304c\u8003\u616e\u3055\u308c\u306a\u3044\u3053\u3068\u304c\u539f\u56e0\u3067\u3059\u3002<\/p>\n<p class=\"fz-ss\">\u3064\u307e\u308a\u3001 <b class=\"fw-600\">CSS\u3060\u3051\u3067\u5b8c\u7d50\u3059\u308b\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u30a2\u30f3\u30ab\u30fc\u30ea\u30f3\u30af<\/b> \u3067\u306f <code>scroll-padding-top<\/code> \u306f\u6b63\u3057\u304f\u52d5\u4f5c\u3057\u307e\u3059\u304c\u3001JavaScript\u304c\u4ecb\u5728\u3059\u308b\u3068\u52b9\u304b\u306a\u304f\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3 class=\"fz-ml\">\u305d\u306e\u4ed6\u306e\u5236\u7d04<\/h3>\n<ul style=\"list-style-type:bullet;\" class=\"my-0.5r\">\n  <li>\u30d8\u30c3\u30c0\u30fc\u306e\u9ad8\u3055\u304cPC\/SP\u3067\u7570\u306a\u308b\u5834\u5408\u3001\u30e1\u30c7\u30a3\u30a2\u30af\u30a8\u30ea\u3067\u306e\u5207\u308a\u66ff\u3048\u304c\u5fc5\u8981<\/li>\n  <li>\u500b\u5225\u306e\u30a2\u30f3\u30ab\u30fc\u30dd\u30a4\u30f3\u30c8\u3054\u3068\u306b\u7570\u306a\u308b\u30aa\u30d5\u30bb\u30c3\u30c8\u5024\u3092\u8a2d\u5b9a\u3067\u304d\u306a\u3044<\/li>\n  <li>\u53ef\u5909\u9ad8\u3055\u306e\u30d8\u30c3\u30c0\u30fc\uff08\u30b9\u30af\u30ed\u30fc\u30eb\u3067\u7e2e\u5c0f\u3059\u308b\u306a\u3069\uff09\u3078\u306e\u5bfe\u5fdc\u304c\u96e3\u3057\u3044<\/li>\n<\/ul>\n\n<hr class=\"separator mx-auto mt-3r\" \/>\n\n<h2 class=\"fz-xl\">\u89e3\u6c7a\u7b56\uff1aCSS\u5909\u6570\u3068JavaScript\u3092\u4f7f\u3063\u305f\u65b9\u6cd5<\/h2>\n<p class=\"fz-ss\"><code>scroll-padding-top<\/code> \u306e\u4ee3\u308f\u308a\u306b\u3001\u5f93\u6765\u306e <code>margin-top<\/code> \u3068 <code>padding-top<\/code> \u3092\u4f7f\u3063\u305f\u624b\u6cd5\u3092CSS\u5909\u6570\u3068JavaScript\u3067\u67d4\u8edf\u306b\u5b9f\u88c5\u3057\u307e\u3059\u3002<\/p>\n<h3 class=\"fz-ml\">\u30e1\u30ea\u30c3\u30c8<\/h3>\n<ol style=\"list-style-type:decimal;\" class=\"my-0.5r\">\n  <li><b class=\"fw-600\">\u30ea\u30ed\u30fc\u30c9\u6642\u306e\u30ba\u30ec\u304c\u767a\u751f\u3057\u306a\u3044<\/b> : \u30d6\u30e9\u30a6\u30b6\u306e\u30b9\u30af\u30ed\u30fc\u30eb\u5fa9\u5143\u6a5f\u80fd\u3068\u7af6\u5408\u3057\u306a\u3044<\/li>\n  <li><b class=\"fw-600\">\u67d4\u8edf\u6027<\/b> : \u500b\u5225\u306e\u8981\u7d20\u3054\u3068\u306b\u7570\u306a\u308b\u30aa\u30d5\u30bb\u30c3\u30c8\u5024\u3092\u8a2d\u5b9a\u53ef\u80fd<\/li>\n  <li><b class=\"fw-600\">\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u6027<\/b> : \u30d8\u30c3\u30c0\u30fc\u306e\u9ad8\u3055\u304c\u5909\u66f4\u3055\u308c\u305f\u5834\u5408\u3001CSS\u5909\u6570\u3092\u66f4\u65b0\u3059\u308b\u3060\u3051\u3067\u5168\u4f53\u306b\u53cd\u6620<\/li>\n  <li><b class=\"fw-600\">\u30ec\u30b9\u30dd\u30f3\u30b7\u30d6\u5bfe\u5fdc<\/b> : \u30e1\u30c7\u30a3\u30a2\u30af\u30a8\u30ea\u3067CSS\u5909\u6570\u3092\u5207\u308a\u66ff\u3048\u308b\u3060\u3051\u3067\u5bfe\u5fdc<\/li>\n  <li><b class=\"fw-600\">\u30c7\u30b6\u30a4\u30ca\u30fc\u30d5\u30ec\u30f3\u30c9\u30ea\u30fc<\/b> : HTML\u306e\u5c5e\u6027\u3084\u30a4\u30f3\u30e9\u30a4\u30f3\u30b9\u30bf\u30a4\u30eb\u3067\u7c21\u5358\u306b\u8abf\u6574\u53ef\u80fd<\/li>\n<\/ol>\n\n<hr class=\"separator mx-auto mt-3r\" \/>\n\n<h2 class=\"fz-xl\">\u30b3\u30fc\u30c9\u3068\u89e3\u8aac<\/h2>\n<h3 class=\"fz-ml\">1. CSS<\/h3>\n<pre><code class=\"language-css\">:root {\n\t--header-height: 4pc;\n\t--anchor: var(--header-height);\n}\n\n@media print, screen and (min-width: 744px) {\n\t:root {\n\t\t--header-height: 5.5pc;\n\t\t--anchor: var(--header-height);\n\t}\n}\n\n\/* \u30a2\u30f3\u30ab\u30fc\u30ea\u30f3\u30af\u4f4d\u7f6e\u8abf\u6574\uff08\u30d5\u30a9\u30fc\u30eb\u30d0\u30c3\u30af\u7528\uff09 *\/\n&lsqb;anchor&rsqb; {\n\tmargin-top: calc(var(--anchor) * -1);\n\tpadding-top: var(--anchor);\n}<\/code><\/pre>\n<p class=\"fz-ss\"><code>:root<\/code> \u30bb\u30ec\u30af\u30bf\u3067\u30b0\u30ed\u30fc\u30d0\u30eb\u306aCSS\u5909\u6570\u3092\u5b9a\u7fa9\u3057\u3066\u3044\u307e\u3059\u3002<code>--header-height<\/code> \u306f\u30d8\u30c3\u30c0\u30fc\u306e\u9ad8\u3055\u3001<code>--anchor<\/code> \u306f\u30a2\u30f3\u30ab\u30fc\u30ea\u30f3\u30af\u306e\u8abf\u6574\u5024\u3067\u3059\u3002\u30e1\u30c7\u30a3\u30a2\u30af\u30a8\u30ea\u3067\u753b\u9762\u30b5\u30a4\u30ba\u306b\u5fdc\u3058\u3066\u5024\u3092\u5909\u66f4\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3 class=\"fz-ml\">2. HTML<\/h3>\n<pre><code class=\"language-html\">&lt;!-- \u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u8abf\u6574\u3092\u4f7f\u7528\uff08--anchor\u5909\u6570\u304c\u9069\u7528\u3055\u308c\u308b\uff09 --&gt;\n&lt;section id=\"about\" anchor&gt;\n\t&lt;h2&gt;About&lt;\/h2&gt;\n\t...\n&lt;\/section&gt;\n\n&lt;!-- \u30ab\u30b9\u30bf\u30e0\u5024\u3067\u8abf\u6574 --&gt;\n&lt;section id=\"service\" anchor=\"120px\"&gt;\n\t&lt;h2&gt;Service&lt;\/h2&gt;\n\t...\n&lt;\/section&gt;\n\n&lt;!-- \u5358\u4f4d\u7701\u7565\u53ef\uff08px\u3068\u3057\u3066\u6271\u308f\u308c\u308b\uff09 --&gt;\n&lt;section id=\"contact\" anchor=\"100\"&gt;\n\t&lt;h2&gt;Contact&lt;\/h2&gt;\n\t...\n&lt;\/section&gt;\n\n&lt;!-- CSS\u5909\u6570\u3092\u76f4\u63a5\u6307\u5b9a --&gt;\n&lt;section id=\"news\" anchor=\"var(--header-height)\"&gt;\n\t&lt;h2&gt;News&lt;\/h2&gt;\n\t...\n&lt;\/section&gt;\n\n&lt;!-- ID\u306a\u3057\u3067\u3082OK\uff08\u81ea\u52d5\u751f\u6210\u3055\u308c\u308b\uff09 --&gt;\n&lt;hr anchor=\"5pc\"&gt;<\/code><\/pre>\n<p class=\"fz-ss\"><code>anchor<\/code> \u5c5e\u6027\u3092\u8ffd\u52a0\u3059\u308b\u3060\u3051\u3067\u3001\u30a2\u30f3\u30ab\u30fc\u30ea\u30f3\u30af\u306e\u4f4d\u7f6e\u8abf\u6574\u304c\u9069\u7528\u3055\u308c\u307e\u3059\u3002\u5024\u3092\u6307\u5b9a\u3059\u308c\u3070\u500b\u5225\u306e\u30aa\u30d5\u30bb\u30c3\u30c8\u3082\u53ef\u80fd\u3067\u3059\u3002[^1]<\/p>\n<h3 class=\"fz-ml\">3. JavaScript<\/h3>\n<pre><code class=\"language-javascript\">(function () {\n\t\/\/_instyle-anchor.js\n\t\/\/&lsqb;anchor&rsqb; \u5c5e\u6027\u3092\u6301\u3064\u3059\u3079\u3066\u306e\u8981\u7d20\u3092\u53d6\u5f97\n\tconst elements = document.querySelectorAll('&lsqb;anchor&rsqb;');\n\n\t\/\/\u30b9\u30bf\u30a4\u30eb\u8981\u7d20\u3092\u4f5c\u6210\uff08\u4e00\u5ea6\u3060\u3051\u4f5c\u6210\uff09\n\tconst STYLE = document.createElement('style');\n\tdocument.head.appendChild(STYLE);\n\n\telements.forEach((el) =&gt; {\n\t\t\/\/anchor \u5c5e\u6027\u304b\u3089\u5024\u3092\u53d6\u5f97\n\t\tconst anchorValue = el.getAttribute('anchor');\n\n\t\t\/\/ID\u3092\u53d6\u5f97\u3001\u306a\u3051\u308c\u3070\u30e9\u30f3\u30c0\u30e0ID\u3092\u751f\u6210\n\t\tlet id = el.id || 'anchor-' + Math.random().toString(36).substr(2, 9);\n\t\tel.id = id;\n\n\t\tlet anchorStyle = '';\n\n\t\tif (anchorValue) {\n\t\t\t\/\/\u5024\u3068\u5358\u4f4d\u3092\u5206\u96e2\u3059\u308b\u6b63\u898f\u8868\u73fe\uff08'r'\u3082\u542b\u3081\u308b\uff09\n\t\t\tconst match = anchorValue.match(\/^(\\d*\\.?\\d+)(px|pc|r|rem|vw|vh|em)?$\/);\n\n\t\t\tif (match) {\n\t\t\t\tconst value = parseFloat(match&lsqb;1&rsqb;);\n\t\t\t\tlet unit = match&lsqb;2&rsqb; || 'px'; \/\/\u5358\u4f4d\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306fpx\u3068\u3059\u308b\n\n\t\t\t\t\/\/'r' \u3092 'rem' \u306b\u5909\u63db\n\t\t\t\tif (unit === 'r') {\n\t\t\t\t\tunit = 'rem';\n\t\t\t\t}\n\n\t\t\t\t\/\/CSS\u30eb\u30fc\u30eb\u3092\u751f\u6210\uff08\u6570\u5024\uff0b\u5358\u4f4d\u306e\u5834\u5408\uff09\n\t\t\t\tanchorStyle = `\n\t\t\t\t#${id} {\n\t\t\t\t\tmargin-top: -${value}${unit};\n\t\t\t\t\tpadding-top: ${value}${unit};\n\t\t\t\t}\n\t\t\t\t`;\n\t\t\t} else {\n\t\t\t\t\/\/\u6570\u5024\u30fb\u5358\u4f4d\u3067\u306a\u3044\u5834\u5408\uff08CSS\u5909\u6570\u306a\u3069\uff09\u306f\u305d\u306e\u307e\u307e\u4f7f\u7528\n\t\t\t\tanchorStyle = `\n\t\t\t\t#${id} {\n\t\t\t\t\tmargin-top: calc(-1 * (${anchorValue}));\n\t\t\t\t\tpadding-top: ${anchorValue};\n\t\t\t\t}\n\t\t\t\t`;\n\t\t\t}\n\t\t} else {\n\t\t\t\/\/\u5c5e\u6027\u5024\u304c\u306a\u3044\u5834\u5408\u306fCSS\u5909\u6570\u3092\u30d5\u30a9\u30fc\u30eb\u30d0\u30c3\u30af\n\t\t\tanchorStyle = `\n\t\t\t#${id} {\n\t\t\t\tmargin-top: calc(-1 * var(--anchor));\n\t\t\t\tpadding-top: var(--anchor);\n\t\t\t}\n\t\t\t`;\n\t\t}\n\n\t\t\/\/\u30b9\u30bf\u30a4\u30eb\u306b\u8ffd\u52a0\uff08\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u4ed8\u304d\uff09\n\t\ttry {\n\t\t\tSTYLE.sheet.insertRule(anchorStyle, STYLE.sheet.cssRules.length);\n\t\t} catch (e) {\n\t\t\tconsole.error(`Failed to insert CSS rule for element with id \"${id}\": ${e.message}`);\n\t\t}\n\t});\n})();<\/code><\/pre>\n<h3 class=\"fz-ml\">JavaScript\u306e\u52d5\u4f5c<\/h3>\n<ol style=\"list-style-type:decimal;\" class=\"my-0.5r\">\n  <li><code>anchor<\/code> \u5c5e\u6027\u3092\u6301\u3064\u3059\u3079\u3066\u306e\u8981\u7d20\u3092\u9078\u629e<\/li>\n  <li>\u65b0\u3057\u3044 <code>&lt;style&gt;<\/code> \u8981\u7d20\u3092\u4f5c\u6210<\/li>\n  <li>\u5404\u8981\u7d20\u306b\u5bfe\u3057\u3066\uff1a\n    <ul style=\"list-style-type:bullet;\" class=\"my-0.5r\">\n      <li><code>anchor<\/code> \u5c5e\u6027\u306e\u5024\u3092\u53d6\u5f97<\/li>\n      <li>ID\u304c\u306a\u3051\u308c\u3070\u30e9\u30f3\u30c0\u30e0ID\u3092\u81ea\u52d5\u751f\u6210<\/li>\n      <li>\u5024\u306e\u5f62\u5f0f\u306b\u5fdc\u3058\u3066CSS\u30eb\u30fc\u30eb\u3092\u751f\u6210<\/li>\n      <li>\u751f\u6210\u3057\u305f\u30eb\u30fc\u30eb\u3092\u30b9\u30bf\u30a4\u30eb\u30b7\u30fc\u30c8\u306b\u633f\u5165<\/li>\n    <\/ul>\n  <\/li>\n<\/ol>\n<h3 class=\"fz-ml\">\u5bfe\u5fdc\u3059\u308b\u5024\u306e\u5f62\u5f0f<\/h3>\n<table class=\"table my-0.75r\">\n  <thead>\n    <tr>\n      <th>\u6307\u5b9a\u65b9\u6cd5<\/th>\n      <td>\u4f8b<\/td>\n      <td>\u7d50\u679c<\/td>\n    <\/tr>\n  <\/thead>\n  <tbody>\n    <tr>\n      <th>\u6570\u5024+\u5358\u4f4d<\/th>\n      <td><code>anchor=&quot;120px&quot;<\/code><\/td>\n      <td><code>margin-top: -120px; padding-top: 120px;<\/code><\/td>\n    <\/tr>\n    <tr>\n      <th>\u6570\u5024\u306e\u307f<\/th>\n      <td><code>anchor=&quot;100&quot;<\/code><\/td>\n      <td><code>margin-top: -100px; padding-top: 100px;<\/code><\/td>\n    <\/tr>\n    <tr>\n      <th>rem\u7701\u7565\u5f62<\/th>\n      <td><code>anchor=&quot;5r&quot;<\/code><\/td>\n      <td><code>margin-top: -5rem; padding-top: 5rem;<\/code><\/td>\n    <\/tr>\n    <tr>\n      <th>CSS\u5909\u6570<\/th>\n      <td><code>anchor=&quot;var(--header-height)&quot;<\/code><\/td>\n      <td>CSS\u5909\u6570\u304c\u305d\u306e\u307e\u307e\u9069\u7528<\/td>\n    <\/tr>\n    <tr>\n      <th>\u5024\u306a\u3057<\/th>\n      <td><code>anchor<\/code><\/td>\n      <td><code>var(--anchor)<\/code> \u304c\u9069\u7528<\/td>\n    <\/tr>\n  <\/tbody>\n<\/table>\n\n<hr class=\"separator mx-auto mt-3r\" \/>\n\n<h2 class=\"fz-xl\">\u307e\u3068\u3081<\/h2>\n<p class=\"fz-ss\"><code>scroll-padding-top<\/code> \u306f\u30b7\u30f3\u30d7\u30eb\u3067\u4fbf\u5229\u306a\u30d7\u30ed\u30d1\u30c6\u30a3\u3067\u3059\u304c\u3001Scroll Restoration\uff08\u30d6\u30e9\u30a6\u30b6\u306e\u30b9\u30af\u30ed\u30fc\u30eb\u4f4d\u7f6e\u5fa9\u5143\u6a5f\u80fd\uff09\u4ee5\u5916\u306b\u3082\u300c\u30d5\u30a9\u30fc\u30ab\u30b9\u79fb\u52d5\u6642\u306e\u30b9\u30af\u30ed\u30fc\u30eb\u300d\u300cSafari \u306e rem \u89e3\u91c8\u300d\u306a\u3069\u3001\u8907\u6570\u306e\u843d\u3068\u3057\u7a74\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p class=\"fz-ss\">CSS\u5909\u6570\u3068JavaScript\u3092\u7d44\u307f\u5408\u308f\u305b\u305f\u624b\u6cd5\u306a\u3089\uff1a<\/p>\n<ul style=\"list-style-type:bullet;\" class=\"my-0.5r\">\n  <li>\u30ea\u30ed\u30fc\u30c9\u6642\u306e\u30ba\u30ec\u304c\u767a\u751f\u3057\u306a\u3044<\/li>\n  <li>\u500b\u5225\u306e\u30a2\u30f3\u30ab\u30fc\u30dd\u30a4\u30f3\u30c8\u3054\u3068\u306b\u7570\u306a\u308b\u30aa\u30d5\u30bb\u30c3\u30c8\u5024\u3092\u8a2d\u5b9a\u3067\u304d\u308b<\/li>\n  <li>\u30ec\u30b9\u30dd\u30f3\u30b7\u30d6\u5bfe\u5fdc\u3082\u5bb9\u6613<\/li>\n  <li>HTML\u306e\u5c5e\u6027\u3067\u76f4\u611f\u7684\u306b\u8abf\u6574\u3067\u304d\u308b<\/li>\n<\/ul>\n<p class=\"fz-ss\">\u56fa\u5b9a\u30d8\u30c3\u30c0\u30fc\u3092\u4f7f\u7528\u3059\u308b\u30ec\u30b9\u30dd\u30f3\u30b7\u30d6\u30c7\u30b6\u30a4\u30f3\u306e\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u3067\u7279\u306b\u6709\u7528\u306a\u624b\u6cd5\u3067\u3059\u3002<\/p>\n<hr class=\"separator mt-3r\">\n\n<hr class=\"separator mx-auto mt-3r\" \/>\n\n<h2 class=\"fz-xl\">\u53c2\u8003<\/h2>\n<ul style=\"list-style-type:bullet;\" class=\"my-0.5r\">\n  <li><a href=\"https:\/\/developer.mozilla.org\/ja\/docs\/Web\/CSS\/scroll-padding-top\" class=\"link\">MDN Web Docs - scroll-padding-top<\/a><\/li>\n  <li><a href=\"https:\/\/developer.mozilla.org\/ja\/docs\/Web\/API\/History\/scrollRestoration\" class=\"link\">MDN Web Docs - History.scrollRestoration<\/a><\/li>\n  <li><a href=\"https:\/\/stackoverflow.com\/questions\/72581132\/how-does-the-css-property-scroll-margin-top-and-scroll-padding-top-really-wo\" class=\"link\">Stack Overflow - How does the CSS property &quot;scroll-margin-top&quot; and &quot;scroll-padding-top&quot; really work<\/a><\/li>\n  <li><a href=\"https:\/\/github.com\/vercel\/next.js\/issues\/49612\" class=\"link\">GitHub - Next.js Issue #49612: Link to anchor doesn&#39;t respect scroll-padding properties in App Router<\/a><\/li>\n  <li><a href=\"https:\/\/css-tricks.com\/fixed-headers-and-jump-links-the-solution-is-scroll-margin-top\/\" class=\"link\">CSS-Tricks - Fixed Headers and Jump Links? The Solution is scroll-margin-top<\/a><\/li>\n  <li><a href=\"https:\/\/naopoyo.com\/docs\/diary-2024-01-09\/\" class=\"link\">\u958b\u767a\u65e5\u8a18-2024-01-09 \/ scroll-padding\u3001scroll-margin\u306b\u3064\u3044\u3066<\/a><\/li>\n<\/ul>\n<p class=\"fz-ss\">[^1]: \u53b3\u5bc6\u306b\u306f\u3001data-anchor \u306e\u65b9\u304c\u3044\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p class=\"fz-ss\">\u56fa\u5b9a\u30d8\u30c3\u30c0\u30fc\u306e\u3042\u308b\u30b5\u30a4\u30c8\u3067\u30a2\u30f3\u30ab\u30fc\u30ea\u30f3\u30af\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u30b8\u30e3\u30f3\u30d7\u5148\u304c\u30d8\u30c3\u30c0\u30fc\u306e\u4e0b\u306b\u96a0\u308c\u3066\u3057\u307e\u3046\u554f\u984c\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u554f\u984c\u3092\u89e3\u6c7a\u3059\u308b\u65b9\u6cd5\u3068\u3057\u3066 <code>scroll-padding-top<\/code> \u304c\u5e83\u304f\u77e5\u3089\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u5b9f\u306f <font><b class=\"fw-600\">\u30ea\u30ed\u30fc\u30c9\u6642\u306b\u30da\u30fc\u30b8\u304c\u30ba\u30ec\u308b<\/b><\/font> \u3068\u3044\u3046\u554f\u984c\u304c\u3042\u308b\u3053\u3068\u3092\u3054\u5b58\u77e5\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p class=\"fz-ss\">\n  <font>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001<code>scroll-padding-top<\/code> \u306e\u554f\u984c\u70b9\u3068\u3001CSS\u5909\u6570<font>$\\small{\\mathrm{\u3068}}$<\/font>JavaScript\u3092\u7d44\u307f\u5408\u308f\u305b\u305f\u4ee3\u66ff\u624b\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/font>\n<\/p>\n\n<hr class=\"separator mx-auto mt-3r\" \/>\n\n<h2 class=\"fz-xl\">scroll-padding-top\u3068\u306f<\/h2>\n<p class=\"fz-ss\"><code>scroll-padding-top<\/code> \u306f\u3001\u30b9\u30af\u30ed\u30fc\u30eb\u30b9\u30ca\u30c3\u30d7\u3084\u30a2\u30f3\u30ab\u30fc\u30ea\u30f3\u30af\u306e\u30b8\u30e3\u30f3\u30d7\u4f4d\u7f6e\u3092\u8abf\u6574\u3059\u308bCSS\u30d7\u30ed\u30d1\u30c6\u30a3\u3067\u3059\u3002<\/p>\n<pre><code class=\"language-css\">html {\n\tscroll-padding-top: 80px; \/* \u30d8\u30c3\u30c0\u30fc\u306e\u9ad8\u3055\u5206 *\/\n\tscroll-behavior: smooth;  \/* \u30b9\u30e0\u30fc\u30b9\u30b9\u30af\u30ed\u30fc\u30eb *\/\n}<\/code><\/pre>\n<p class=\"fz-ss\">\u305f\u3063\u305f\u3053\u308c\u3060\u3051\u3067\u3001\u30a2\u30f3\u30ab\u30fc\u30ea\u30f3\u30af\u306e\u30b8\u30e3\u30f3\u30d7\u5148\u304c\u30d8\u30c3\u30c0\u30fc\u306e\u9ad8\u3055\u5206\u3060\u3051\u4e0a\u306b\u30aa\u30d5\u30bb\u30c3\u30c8\u3055\u308c\u307e\u3059\u3002\u4e3b\u8981\u30d6\u30e9\u30a6\u30b6\u3067\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u304a\u308a\u3001\u975e\u5e38\u306b\u30b7\u30f3\u30d7\u30eb\u306a\u89e3\u6c7a\u7b56\u3068\u3057\u3066\u591a\u304f\u306e\u30b5\u30a4\u30c8\u3067\u63a1\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n<hr class=\"separator mx-auto mt-3r\" \/>\n\n<h2 class=\"fz-xl\">scroll-padding-top\u306e\u554f\u984c\u70b9<\/h2>\n<h3 class=\"fz-ml\">\u30ea\u30ed\u30fc\u30c9\u6642\u306b\u30da\u30fc\u30b8\u304c\u30ba\u30ec\u308b<\/h3>\n<p class=\"fz-ss\"><code>scroll-padding-top<\/code> \u3092\u8a2d\u5b9a\u3057\u305f\u30b5\u30a4\u30c8\u3067\u3001\u30d5\u30ed\u30f3\u30c8\u30da\u30fc\u30b8\uff08\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\uff09\u3092\u30ea\u30ed\u30fc\u30c9\u3059\u308b\u3068\u3001\u672c\u6765\u30da\u30fc\u30b8\u306e\u5148\u982d\u304b\u3089\u8868\u793a\u3055\u308c\u308b\u3079\u304d\u3068\u3053\u308d\u304c\u3001<code>scroll-padding-top<\/code> \u306e\u5024\u3060\u3051\u4e0b\u306b\u30ba\u30ec\u3066\u8868\u793a\u3055\u308c\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p class=\"fz-ss\">\u4f8b\u3048\u3070 <code>scroll-padding-top: 150px;<\/code> \u3068\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u5834\u5408\u3001\u30ea\u30ed\u30fc\u30c9\u3059\u308b\u3068\u30da\u30fc\u30b8\u304c150px\u5206\u4e0b\u306b\u30b9\u30af\u30ed\u30fc\u30eb\u3057\u305f\u72b6\u614b\u3067\u8868\u793a\u3055\u308c\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<h3 class=\"fz-ml\">\u306a\u305c\u30ea\u30ed\u30fc\u30c9\u6642\u306b\u30ba\u30ec\u308b\u306e\u304b<\/h3>\n<p class=\"fz-ss\">\u3053\u306e\u73fe\u8c61\u306f\u3001\u30d6\u30e9\u30a6\u30b6\u306e <b class=\"fw-600\">\u30b9\u30af\u30ed\u30fc\u30eb\u4f4d\u7f6e\u5fa9\u5143\u6a5f\u80fd\uff08Scroll Restoration\uff09<\/b> \u3068 <code>scroll-padding-top<\/code> \u304c\u7af6\u5408\u3059\u308b\u3053\u3068\u3067\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n<ol style=\"list-style-type:decimal;\" class=\"my-0.5r\">\n  <li><b class=\"fw-600\">\u30d6\u30e9\u30a6\u30b6\u306e\u30b9\u30af\u30ed\u30fc\u30eb\u5fa9\u5143\u6a5f\u80fd<\/b> : \u30d6\u30e9\u30a6\u30b6\u306f\u901a\u5e38\u3001\u30da\u30fc\u30b8\u306e\u30ea\u30ed\u30fc\u30c9\u6642\u306b\u524d\u56de\u306e\u30b9\u30af\u30ed\u30fc\u30eb\u4f4d\u7f6e\u3092\u8a18\u61b6\u3057\u3066\u5fa9\u5143\u3057\u3088\u3046\u3068\u3057\u307e\u3059<\/li>\n<\/ol>\n<ol start=\"2\" style=\"list-style-type:decimal;\" class=\"my-0.5r\">\n  <li><b class=\"fw-600\">scroll-padding-top\u306e\u9069\u7528\u30bf\u30a4\u30df\u30f3\u30b0<\/b> : CSS\u3067\u5b9a\u7fa9\u3055\u308c\u305f\u30d1\u30c7\u30a3\u30f3\u30b0\u304c\u8a08\u7b97\u306b\u53cd\u6620\u3055\u308c\u308b\u524d\u306b\u30b9\u30af\u30ed\u30fc\u30eb\u304c\u5b8c\u4e86\u3057\u3066\u3057\u307e\u3046\u3053\u3068\u304c\u3042\u308a\u307e\u3059<\/li>\n<\/ol>\n<ol start=\"3\" style=\"list-style-type:decimal;\" class=\"my-0.5r\">\n  <li><b class=\"fw-600\">\u9069\u7528\u5bfe\u8c61\u306e\u554f\u984c<\/b> : <code>scroll-padding-top<\/code> \u306f\u901a\u5e38\u3001html\u8981\u7d20\u3084body\u8981\u7d20\u3001\u3042\u308b\u3044\u306f\u30b9\u30af\u30ed\u30fc\u30eb\u30b3\u30f3\u30c6\u30ca\u81ea\u4f53\u306b\u9069\u7528\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u304c\u6b63\u3057\u304f\u9069\u7528\u3055\u308c\u3066\u3044\u306a\u3044\u3068\u3001\u521d\u56de\u306e\u30af\u30ea\u30c3\u30af\u6642\u306f\u52d5\u4f5c\u3057\u3066\u3082\u3001\u30ea\u30ed\u30fc\u30c9\u306a\u3069\u306e\u30b7\u30b9\u30c6\u30e0\u7684\u306a\u30b9\u30af\u30ed\u30fc\u30eb\u6642\u306b\u306f\u7121\u8996\u3055\u308c\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059<\/li>\n<\/ol>\n<ol start=\"4\" style=\"list-style-type:decimal;\" class=\"my-0.5r\">\n  <li><b class=\"fw-600\">\u52d5\u7684\u306a\u30b3\u30f3\u30c6\u30f3\u30c4\u306e\u8aad\u307f\u8fbc\u307f<\/b> : \u753b\u50cf\u3084Web\u30d5\u30a9\u30f3\u30c8\u3001\u3042\u308b\u3044\u306fJavaScript\u306b\u3088\u308b\u8981\u7d20\u306e\u751f\u6210\u306a\u3069\u3001\u30da\u30fc\u30b8\u306e\u9ad8\u3055\u304c\u30ea\u30ed\u30fc\u30c9\u5f8c\u306b\u52d5\u7684\u306b\u5909\u308f\u308b\u5834\u5408\u3001\u30d6\u30e9\u30a6\u30b6\u304c\u4f4d\u7f6e\u3092\u7279\u5b9a\u3057\u305f\u6642\u70b9\u3068\u6700\u7d42\u7684\u306a\u30ec\u30a4\u30a2\u30a6\u30c8\u304c\u5b8c\u6210\u3057\u305f\u6642\u70b9\u3067\u4f4d\u7f6e\u306b\u5dee\u7570\u304c\u751f\u3058\u307e\u3059<\/li>\n<\/ol>\n<p class=\"fz-ss\">\u30ea\u30ed\u30fc\u30c9\u6642\u306e\u6319\u52d5\u306f\u30d6\u30e9\u30a6\u30b6\u306e\u4ed5\u69d8\uff08Chrome, Firefox, Safari\u7b49\uff09\u306b\u3088\u3063\u3066\u5fae\u5999\u306b\u512a\u5148\u9806\u4f4d\u304c\u7570\u306a\u308b\u305f\u3081\u3001\u3059\u3079\u3066\u306e\u74b0\u5883\u3067\u5b8c\u74a7\u306b\u52d5\u4f5c\u3055\u305b\u308b\u306b\u306f\u3001\u524d\u8ff0\u306e\u3088\u3046\u306aJavaScript\u306b\u3088\u308b\u88dc\u6b63\u304c\u5fc5\u8981\u306b\u306a\u308b\u30b1\u30fc\u30b9\u304c\u4f9d\u7136\u3068\u3057\u3066\u591a\u3044\u306e\u304c\u73fe\u72b6\u3067\u3059\u3002<\/p>\n<h3 class=\"fz-ml\">JavaScript\u306b\u3088\u308b\u30b9\u30af\u30ed\u30fc\u30eb\u5236\u5fa1\u3068\u306e\u7af6\u5408<\/h3>\n<p class=\"fz-ss\"><code>scroll-padding-top<\/code> \u3084 <code>scroll-margin-top<\/code> \u306f\u3001 <b class=\"fw-600\">JavaScript\u3067\u30b9\u30af\u30ed\u30fc\u30eb\u52d5\u4f5c\u3092\u5236\u5fa1\u3057\u3066\u3044\u308b\u5834\u5408\u3001\u7121\u8996\u3055\u308c\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059<\/b> \u3002<\/p>\n<p class=\"fz-ss\">\u5177\u4f53\u7684\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b1\u30fc\u30b9\u3067\u554f\u984c\u304c\u767a\u751f\u3057\u307e\u3059\uff1a<\/p>\n<ul style=\"list-style-type:bullet;\" class=\"my-0.5r\">\n  <li><b class=\"fw-600\">jQuery\u30d7\u30e9\u30b0\u30a4\u30f3<\/b> : WordPress\u306e\u76ee\u6b21\u30d7\u30e9\u30b0\u30a4\u30f3\uff08Easy Table of Contents \u306a\u3069\uff09\u304csmooth-scroll\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408<\/li>\n  <li><b class=\"fw-600\">Next.js<\/b> : App Router\u306e <code>Link<\/code> \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3067\u30a2\u30f3\u30ab\u30fc\u30ea\u30f3\u30af\u3092\u4f7f\u7528\u3057\u305f\u5834\u5408\uff08v13.4.3\u3067\u4fee\u6b63\u6e08\u307f\uff09<\/li>\n  <li><b class=\"fw-600\">React Router<\/b> : \u540c\u69d8\u306bJavaScript\u3067\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u5236\u5fa1\u3057\u3066\u3044\u308b\u5834\u5408<\/li>\n  <li><b class=\"fw-600\">\u30ab\u30b9\u30bf\u30e0\u30b9\u30e0\u30fc\u30b9\u30b9\u30af\u30ed\u30fc\u30eb<\/b> : \u72ec\u81ea\u306eJavaScript\u3067\u30b9\u30af\u30ed\u30fc\u30eb\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u88c5\u3057\u3066\u3044\u308b\u5834\u5408<\/li>\n<\/ul>\n<p class=\"fz-ss\">\u3053\u308c\u306f\u3001JavaScript\u304c <code>window.scrollTo()<\/code> \u3084 <code>element.scrollIntoView()<\/code> \u306a\u3069\u306eAPI\u3092\u4f7f\u7528\u3057\u3066\u30b9\u30af\u30ed\u30fc\u30eb\u4f4d\u7f6e\u3092\u76f4\u63a5\u5236\u5fa1\u3059\u308b\u5834\u5408\u3001CSS\u306e <code>scroll-padding<\/code> \u30d7\u30ed\u30d1\u30c6\u30a3\u304c\u8003\u616e\u3055\u308c\u306a\u3044\u3053\u3068\u304c\u539f\u56e0\u3067\u3059\u3002<\/p>\n<p class=\"fz-ss\">\u3064\u307e\u308a\u3001 <b class=\"fw-600\">CSS\u3060\u3051\u3067\u5b8c\u7d50\u3059\u308b\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u30a2\u30f3\u30ab\u30fc\u30ea\u30f3\u30af<\/b> \u3067\u306f <code>scroll-padding-top<\/code> \u306f\u6b63\u3057\u304f\u52d5\u4f5c\u3057\u307e\u3059\u304c\u3001JavaScript\u304c\u4ecb\u5728\u3059\u308b\u3068\u52b9\u304b\u306a\u304f\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3 class=\"fz-ml\">\u305d\u306e\u4ed6\u306e\u5236\u7d04<\/h3>\n<ul style=\"list-style-type:bullet;\" class=\"my-0.5r\">\n  <li>\u30d8\u30c3\u30c0\u30fc\u306e\u9ad8\u3055\u304cPC\/SP\u3067\u7570\u306a\u308b\u5834\u5408\u3001\u30e1\u30c7\u30a3\u30a2\u30af\u30a8\u30ea\u3067\u306e\u5207\u308a\u66ff\u3048\u304c\u5fc5\u8981<\/li>\n  <li>\u500b\u5225\u306e\u30a2\u30f3\u30ab\u30fc\u30dd\u30a4\u30f3\u30c8\u3054\u3068\u306b\u7570\u306a\u308b\u30aa\u30d5\u30bb\u30c3\u30c8\u5024\u3092\u8a2d\u5b9a\u3067\u304d\u306a\u3044<\/li>\n  <li>\u53ef\u5909\u9ad8\u3055\u306e\u30d8\u30c3\u30c0\u30fc\uff08\u30b9\u30af\u30ed\u30fc\u30eb\u3067\u7e2e\u5c0f\u3059\u308b\u306a\u3069\uff09\u3078\u306e\u5bfe\u5fdc\u304c\u96e3\u3057\u3044<\/li>\n<\/ul>\n\n<hr class=\"separator mx-auto mt-3r\" \/>\n\n<h2 class=\"fz-xl\">\u89e3\u6c7a\u7b56\uff1aCSS\u5909\u6570\u3068JavaScript\u3092\u4f7f\u3063\u305f\u65b9\u6cd5<\/h2>\n<p class=\"fz-ss\"><code>scroll-padding-top<\/code> \u306e\u4ee3\u308f\u308a\u306b\u3001\u5f93\u6765\u306e <code>margin-top<\/code> \u3068 <code>padding-top<\/code> \u3092\u4f7f\u3063\u305f\u624b\u6cd5\u3092CSS\u5909\u6570\u3068JavaScript\u3067\u67d4\u8edf\u306b\u5b9f\u88c5\u3057\u307e\u3059\u3002<\/p>\n<h3 class=\"fz-ml\">\u30e1\u30ea\u30c3\u30c8<\/h3>\n<ol style=\"list-style-type:decimal;\" class=\"my-0.5r\">\n  <li><b class=\"fw-600\">\u30ea\u30ed\u30fc\u30c9\u6642\u306e\u30ba\u30ec\u304c\u767a\u751f\u3057\u306a\u3044<\/b> : \u30d6\u30e9\u30a6\u30b6\u306e\u30b9\u30af\u30ed\u30fc\u30eb\u5fa9\u5143\u6a5f\u80fd\u3068\u7af6\u5408\u3057\u306a\u3044<\/li>\n  <li><b class=\"fw-600\">\u67d4\u8edf\u6027<\/b> : \u500b\u5225\u306e\u8981\u7d20\u3054\u3068\u306b\u7570\u306a\u308b\u30aa\u30d5\u30bb\u30c3\u30c8\u5024\u3092\u8a2d\u5b9a\u53ef\u80fd<\/li>\n  <li><b class=\"fw-600\">\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u6027<\/b> : \u30d8\u30c3\u30c0\u30fc\u306e\u9ad8\u3055\u304c\u5909\u66f4\u3055\u308c\u305f\u5834\u5408\u3001CSS\u5909\u6570\u3092\u66f4\u65b0\u3059\u308b\u3060\u3051\u3067\u5168\u4f53\u306b\u53cd\u6620<\/li>\n  <li><b class=\"fw-600\">\u30ec\u30b9\u30dd\u30f3\u30b7\u30d6\u5bfe\u5fdc<\/b> : \u30e1\u30c7\u30a3\u30a2\u30af\u30a8\u30ea\u3067CSS\u5909\u6570\u3092\u5207\u308a\u66ff\u3048\u308b\u3060\u3051\u3067\u5bfe\u5fdc<\/li>\n  <li><b class=\"fw-600\">\u30c7\u30b6\u30a4\u30ca\u30fc\u30d5\u30ec\u30f3\u30c9\u30ea\u30fc<\/b> : HTML\u306e\u5c5e\u6027\u3084\u30a4\u30f3\u30e9\u30a4\u30f3\u30b9\u30bf\u30a4\u30eb\u3067\u7c21\u5358\u306b\u8abf\u6574\u53ef\u80fd<\/li>\n<\/ol>\n\n<hr class=\"separator mx-auto mt-3r\" \/>\n\n<h2 class=\"fz-xl\">\u30b3\u30fc\u30c9\u3068\u89e3\u8aac<\/h2>\n<h3 class=\"fz-ml\">1. CSS<\/h3>\n<pre><code class=\"language-css\">:root {\n\t--header-height: 4pc;\n\t--anchor: var(--header-height);\n}\n\n@media print, screen and (min-width: 744px) {\n\t:root {\n\t\t--header-height: 5.5pc;\n\t\t--anchor: var(--header-height);\n\t}\n}\n\n\/* \u30a2\u30f3\u30ab\u30fc\u30ea\u30f3\u30af\u4f4d\u7f6e\u8abf\u6574\uff08\u30d5\u30a9\u30fc\u30eb\u30d0\u30c3\u30af\u7528\uff09 *\/\n&lsqb;anchor&rsqb; {\n\tmargin-top: calc(var(--anchor) * -1);\n\tpadding-top: var(--anchor);\n}<\/code><\/pre>\n<p class=\"fz-ss\"><code>:root<\/code> \u30bb\u30ec\u30af\u30bf\u3067\u30b0\u30ed\u30fc\u30d0\u30eb\u306aCSS\u5909\u6570\u3092\u5b9a\u7fa9\u3057\u3066\u3044\u307e\u3059\u3002<code>--header-height<\/code> \u306f\u30d8\u30c3\u30c0\u30fc\u306e\u9ad8\u3055\u3001<code>--anchor<\/code> \u306f\u30a2\u30f3\u30ab\u30fc\u30ea\u30f3\u30af\u306e\u8abf\u6574\u5024\u3067\u3059\u3002\u30e1\u30c7\u30a3\u30a2\u30af\u30a8\u30ea\u3067\u753b\u9762\u30b5\u30a4\u30ba\u306b\u5fdc\u3058\u3066\u5024\u3092\u5909\u66f4\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3 class=\"fz-ml\">2. HTML<\/h3>\n<pre><code class=\"language-html\">&lt;!-- \u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u8abf\u6574\u3092\u4f7f\u7528\uff08--anchor\u5909\u6570\u304c\u9069\u7528\u3055\u308c\u308b\uff09 --&gt;\n&lt;section id=\"about\" anchor&gt;\n\t&lt;h2&gt;About&lt;\/h2&gt;\n\t...\n&lt;\/section&gt;\n\n&lt;!-- \u30ab\u30b9\u30bf\u30e0\u5024\u3067\u8abf\u6574 --&gt;\n&lt;section id=\"service\" anchor=\"120px\"&gt;\n\t&lt;h2&gt;Service&lt;\/h2&gt;\n\t...\n&lt;\/section&gt;\n\n&lt;!-- \u5358\u4f4d\u7701\u7565\u53ef\uff08px\u3068\u3057\u3066\u6271\u308f\u308c\u308b\uff09 --&gt;\n&lt;section id=\"contact\" anchor=\"100\"&gt;\n\t&lt;h2&gt;Contact&lt;\/h2&gt;\n\t...\n&lt;\/section&gt;\n\n&lt;!-- CSS\u5909\u6570\u3092\u76f4\u63a5\u6307\u5b9a --&gt;\n&lt;section id=\"news\" anchor=\"var(--header-height)\"&gt;\n\t&lt;h2&gt;News&lt;\/h2&gt;\n\t...\n&lt;\/section&gt;\n\n&lt;!-- ID\u306a\u3057\u3067\u3082OK\uff08\u81ea\u52d5\u751f\u6210\u3055\u308c\u308b\uff09 --&gt;\n&lt;hr anchor=\"5pc\"&gt;<\/code><\/pre>\n<p class=\"fz-ss\"><code>anchor<\/code> \u5c5e\u6027\u3092\u8ffd\u52a0\u3059\u308b\u3060\u3051\u3067\u3001\u30a2\u30f3\u30ab\u30fc\u30ea\u30f3\u30af\u306e\u4f4d\u7f6e\u8abf\u6574\u304c\u9069\u7528\u3055\u308c\u307e\u3059\u3002\u5024\u3092\u6307\u5b9a\u3059\u308c\u3070\u500b\u5225\u306e\u30aa\u30d5\u30bb\u30c3\u30c8\u3082\u53ef\u80fd\u3067\u3059\u3002[^1]<\/p>\n<h3 class=\"fz-ml\">3. JavaScript<\/h3>\n<pre><code class=\"language-javascript\">(function () {\n\t\/\/_instyle-anchor.js\n\t\/\/&lsqb;anchor&rsqb; \u5c5e\u6027\u3092\u6301\u3064\u3059\u3079\u3066\u306e\u8981\u7d20\u3092\u53d6\u5f97\n\tconst elements = document.querySelectorAll('&lsqb;anchor&rsqb;');\n\n\t\/\/\u30b9\u30bf\u30a4\u30eb\u8981\u7d20\u3092\u4f5c\u6210\uff08\u4e00\u5ea6\u3060\u3051\u4f5c\u6210\uff09\n\tconst STYLE = document.createElement('style');\n\tdocument.head.appendChild(STYLE);\n\n\telements.forEach((el) =&gt; {\n\t\t\/\/anchor \u5c5e\u6027\u304b\u3089\u5024\u3092\u53d6\u5f97\n\t\tconst anchorValue = el.getAttribute('anchor');\n\n\t\t\/\/ID\u3092\u53d6\u5f97\u3001\u306a\u3051\u308c\u3070\u30e9\u30f3\u30c0\u30e0ID\u3092\u751f\u6210\n\t\tlet id = el.id || 'anchor-' + Math.random().toString(36).substr(2, 9);\n\t\tel.id = id;\n\n\t\tlet anchorStyle = '';\n\n\t\tif (anchorValue) {\n\t\t\t\/\/\u5024\u3068\u5358\u4f4d\u3092\u5206\u96e2\u3059\u308b\u6b63\u898f\u8868\u73fe\uff08'r'\u3082\u542b\u3081\u308b\uff09\n\t\t\tconst match = anchorValue.match(\/^(\\d*\\.?\\d+)(px|pc|r|rem|vw|vh|em)?$\/);\n\n\t\t\tif (match) {\n\t\t\t\tconst value = parseFloat(match&lsqb;1&rsqb;);\n\t\t\t\tlet unit = match&lsqb;2&rsqb; || 'px'; \/\/\u5358\u4f4d\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306fpx\u3068\u3059\u308b\n\n\t\t\t\t\/\/'r' \u3092 'rem' \u306b\u5909\u63db\n\t\t\t\tif (unit === 'r') {\n\t\t\t\t\tunit = 'rem';\n\t\t\t\t}\n\n\t\t\t\t\/\/CSS\u30eb\u30fc\u30eb\u3092\u751f\u6210\uff08\u6570\u5024\uff0b\u5358\u4f4d\u306e\u5834\u5408\uff09\n\t\t\t\tanchorStyle = `\n\t\t\t\t#${id} {\n\t\t\t\t\tmargin-top: -${value}${unit};\n\t\t\t\t\tpadding-top: ${value}${unit};\n\t\t\t\t}\n\t\t\t\t`;\n\t\t\t} else {\n\t\t\t\t\/\/\u6570\u5024\u30fb\u5358\u4f4d\u3067\u306a\u3044\u5834\u5408\uff08CSS\u5909\u6570\u306a\u3069\uff09\u306f\u305d\u306e\u307e\u307e\u4f7f\u7528\n\t\t\t\tanchorStyle = `\n\t\t\t\t#${id} {\n\t\t\t\t\tmargin-top: calc(-1 * (${anchorValue}));\n\t\t\t\t\tpadding-top: ${anchorValue};\n\t\t\t\t}\n\t\t\t\t`;\n\t\t\t}\n\t\t} else {\n\t\t\t\/\/\u5c5e\u6027\u5024\u304c\u306a\u3044\u5834\u5408\u306fCSS\u5909\u6570\u3092\u30d5\u30a9\u30fc\u30eb\u30d0\u30c3\u30af\n\t\t\tanchorStyle = `\n\t\t\t#${id} {\n\t\t\t\tmargin-top: calc(-1 * var(--anchor));\n\t\t\t\tpadding-top: var(--anchor);\n\t\t\t}\n\t\t\t`;\n\t\t}\n\n\t\t\/\/\u30b9\u30bf\u30a4\u30eb\u306b\u8ffd\u52a0\uff08\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u4ed8\u304d\uff09\n\t\ttry {\n\t\t\tSTYLE.sheet.insertRule(anchorStyle, STYLE.sheet.cssRules.length);\n\t\t} catch (e) {\n\t\t\tconsole.error(`Failed to insert CSS rule for element with id \"${id}\": ${e.message}`);\n\t\t}\n\t});\n})();<\/code><\/pre>\n<h3 class=\"fz-ml\">JavaScript\u306e\u52d5\u4f5c<\/h3>\n<ol style=\"list-style-type:decimal;\" class=\"my-0.5r\">\n  <li><code>anchor<\/code> \u5c5e\u6027\u3092\u6301\u3064\u3059\u3079\u3066\u306e\u8981\u7d20\u3092\u9078\u629e<\/li>\n  <li>\u65b0\u3057\u3044 <code>&lt;style&gt;<\/code> \u8981\u7d20\u3092\u4f5c\u6210<\/li>\n  <li>\u5404\u8981\u7d20\u306b\u5bfe\u3057\u3066\uff1a\n    <ul style=\"list-style-type:bullet;\" class=\"my-0.5r\">\n      <li><code>anchor<\/code> \u5c5e\u6027\u306e\u5024\u3092\u53d6\u5f97<\/li>\n      <li>ID\u304c\u306a\u3051\u308c\u3070\u30e9\u30f3\u30c0\u30e0ID\u3092\u81ea\u52d5\u751f\u6210<\/li>\n      <li>\u5024\u306e\u5f62\u5f0f\u306b\u5fdc\u3058\u3066CSS\u30eb\u30fc\u30eb\u3092\u751f\u6210<\/li>\n      <li>\u751f\u6210\u3057\u305f\u30eb\u30fc\u30eb\u3092\u30b9\u30bf\u30a4\u30eb\u30b7\u30fc\u30c8\u306b\u633f\u5165<\/li>\n    <\/ul>\n  <\/li>\n<\/ol>\n<h3 class=\"fz-ml\">\u5bfe\u5fdc\u3059\u308b\u5024\u306e\u5f62\u5f0f<\/h3>\n<table class=\"table my-0.75r\">\n  <thead>\n    <tr>\n      <th>\u6307\u5b9a\u65b9\u6cd5<\/th>\n      <td>\u4f8b<\/td>\n      <td>\u7d50\u679c<\/td>\n    <\/tr>\n  <\/thead>\n  <tbody>\n    <tr>\n      <th>\u6570\u5024+\u5358\u4f4d<\/th>\n      <td><code>anchor=&quot;120px&quot;<\/code><\/td>\n      <td><code>margin-top: -120px; padding-top: 120px;<\/code><\/td>\n    <\/tr>\n    <tr>\n      <th>\u6570\u5024\u306e\u307f<\/th>\n      <td><code>anchor=&quot;100&quot;<\/code><\/td>\n      <td><code>margin-top: -100px; padding-top: 100px;<\/code><\/td>\n    <\/tr>\n    <tr>\n      <th>rem\u7701\u7565\u5f62<\/th>\n      <td><code>anchor=&quot;5r&quot;<\/code><\/td>\n      <td><code>margin-top: -5rem; padding-top: 5rem;<\/code><\/td>\n    <\/tr>\n    <tr>\n      <th>CSS\u5909\u6570<\/th>\n      <td><code>anchor=&quot;var(--header-height)&quot;<\/code><\/td>\n      <td>CSS\u5909\u6570\u304c\u305d\u306e\u307e\u307e\u9069\u7528<\/td>\n    <\/tr>\n    <tr>\n      <th>\u5024\u306a\u3057<\/th>\n      <td><code>anchor<\/code><\/td>\n      <td><code>var(--anchor)<\/code> \u304c\u9069\u7528<\/td>\n    <\/tr>\n  <\/tbody>\n<\/table>\n\n<hr class=\"separator mx-auto mt-3r\" \/>\n\n<h2 class=\"fz-xl\">\u307e\u3068\u3081<\/h2>\n<p class=\"fz-ss\"><code>scroll-padding-top<\/code> \u306f\u30b7\u30f3\u30d7\u30eb\u3067\u4fbf\u5229\u306a\u30d7\u30ed\u30d1\u30c6\u30a3\u3067\u3059\u304c\u3001Scroll Restoration\uff08\u30d6\u30e9\u30a6\u30b6\u306e\u30b9\u30af\u30ed\u30fc\u30eb\u4f4d\u7f6e\u5fa9\u5143\u6a5f\u80fd\uff09\u4ee5\u5916\u306b\u3082\u300c\u30d5\u30a9\u30fc\u30ab\u30b9\u79fb\u52d5\u6642\u306e\u30b9\u30af\u30ed\u30fc\u30eb\u300d\u300cSafari \u306e rem \u89e3\u91c8\u300d\u306a\u3069\u3001\u8907\u6570\u306e\u843d\u3068\u3057\u7a74\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p class=\"fz-ss\">CSS\u5909\u6570\u3068JavaScript\u3092\u7d44\u307f\u5408\u308f\u305b\u305f\u624b\u6cd5\u306a\u3089\uff1a<\/p>\n<ul style=\"list-style-type:bullet;\" class=\"my-0.5r\">\n  <li>\u30ea\u30ed\u30fc\u30c9\u6642\u306e\u30ba\u30ec\u304c\u767a\u751f\u3057\u306a\u3044<\/li>\n  <li>\u500b\u5225\u306e\u30a2\u30f3\u30ab\u30fc\u30dd\u30a4\u30f3\u30c8\u3054\u3068\u306b\u7570\u306a\u308b\u30aa\u30d5\u30bb\u30c3\u30c8\u5024\u3092\u8a2d\u5b9a\u3067\u304d\u308b<\/li>\n  <li>\u30ec\u30b9\u30dd\u30f3\u30b7\u30d6\u5bfe\u5fdc\u3082\u5bb9\u6613<\/li>\n  <li>HTML\u306e\u5c5e\u6027\u3067\u76f4\u611f\u7684\u306b\u8abf\u6574\u3067\u304d\u308b<\/li>\n<\/ul>\n<p class=\"fz-ss\">\u56fa\u5b9a\u30d8\u30c3\u30c0\u30fc\u3092\u4f7f\u7528\u3059\u308b\u30ec\u30b9\u30dd\u30f3\u30b7\u30d6\u30c7\u30b6\u30a4\u30f3\u306e\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u3067\u7279\u306b\u6709\u7528\u306a\u624b\u6cd5\u3067\u3059\u3002<\/p>\n<hr class=\"separator mt-3r\">\n\n<hr class=\"separator mx-auto mt-3r\" \/>\n\n<h2 class=\"fz-xl\">\u53c2\u8003<\/h2>\n<ul style=\"list-style-type:bullet;\" class=\"my-0.5r\">\n  <li><a href=\"https:\/\/developer.mozilla.org\/ja\/docs\/Web\/CSS\/scroll-padding-top\" class=\"link\">MDN Web Docs - scroll-padding-top<\/a><\/li>\n  <li><a href=\"https:\/\/developer.mozilla.org\/ja\/docs\/Web\/API\/History\/scrollRestoration\" class=\"link\">MDN Web Docs - History.scrollRestoration<\/a><\/li>\n  <li><a href=\"https:\/\/stackoverflow.com\/questions\/72581132\/how-does-the-css-property-scroll-margin-top-and-scroll-padding-top-really-wo\" class=\"link\">Stack Overflow - How does the CSS property &quot;scroll-margin-top&quot; and &quot;scroll-padding-top&quot; really work<\/a><\/li>\n  <li><a href=\"https:\/\/github.com\/vercel\/next.js\/issues\/49612\" class=\"link\">GitHub - Next.js Issue #49612: Link to anchor doesn&#39;t respect scroll-padding properties in App Router<\/a><\/li>\n  <li><a href=\"https:\/\/css-tricks.com\/fixed-headers-and-jump-links-the-solution-is-scroll-margin-top\/\" class=\"link\">CSS-Tricks - Fixed Headers and Jump Links? The Solution is scroll-margin-top<\/a><\/li>\n  <li><a href=\"https:\/\/naopoyo.com\/docs\/diary-2024-01-09\/\" class=\"link\">\u958b\u767a\u65e5\u8a18-2024-01-09 \/ scroll-padding\u3001scroll-margin\u306b\u3064\u3044\u3066<\/a><\/li>\n<\/ul>\n<p class=\"fz-ss\">[^1]: \u53b3\u5bc6\u306b\u306f\u3001data-anchor \u306e\u65b9\u304c\u3044\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>","protected":false},"excerpt":{"rendered":"scroll-padding-top\u306f\u30ea\u30ed\u30fc\u30c9\u6642\u306b\u30ba\u30ec\u308b\u554f\u984c\u304c\u3042\u308a\u307e\u3059\u3002\u539f\u56e0\u306f\u30d6\u30e9\u30a6\u30b6\u306e\u30b9\u30af\u30ed\u30fc\u30eb\u5fa9\u5143\u6a5f\u80fd\u3068\u306e\u7af6\u5408\u3002CSS\u5909\u6570\u3068JavaScript\u3092\u4f7f\u3063\u305f\u4ee3\u66ff\u624b\u6cd5\u3067\u3001\u56fa\u5b9a\u30d8\u30c3\u30c0\u30fc\u3067\u3082\u6b63\u78ba\u306a\u30a2\u30f3\u30ab\u30fc\u30ea\u30f3\u30af\u4f4d\u7f6e\u8abf\u6574\u3092\u5b9f\u73fe\u3059\u308b\u65b9\u6cd5\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002","protected":false},"author":1,"featured_media":10145,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[8],"tags":[507,508,509,510,148,80,81,79],"group":[],"pg":[],"class_list":["post-10134","post","type-post","status-publish","format-standard","has-post-thumbnail","category-javascript","tag-507","tag-508","tag-scroll-padding-top","tag-510","tag-javascript","tag-80","tag-css","tag-web"],"acf":[],"_links":{"self":[{"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/posts\/10134","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/comments?post=10134"}],"version-history":[{"count":0,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/posts\/10134\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/media\/10145"}],"wp:attachment":[{"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/media?parent=10134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/categories?post=10134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/tags?post=10134"},{"taxonomy":"group","embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/group?post=10134"},{"taxonomy":"pg","embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/pg?post=10134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}