From 94ab63c54b1d87100c885238984a66974f4d6091 Mon Sep 17 00:00:00 2001 From: Meet Thakur Date: Wed, 16 Oct 2024 00:29:07 +0530 Subject: [PATCH] added a scroll to top button --- assets/css/style.css | 20 ++++++++++++++++++++ index.html | 6 ++++++ scripts/index.js | 25 +++++++++++++++++++++---- 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/assets/css/style.css b/assets/css/style.css index 4f5625e..d9031b4 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -8,6 +8,26 @@ scroll-behavior: smooth; } +/*scroll to top button*/ +#scrollToTopBtn { + display: none; + position: fixed; + bottom: 20px; + right: 30px; + z-index: 99; + border: none; + outline: none; + background-color: #555; + color: white; + cursor: pointer; + padding: 10px; + border-radius: 5px; + font-size: 12px; +} + +#scrollToTopBtn:hover { + background-color: #333; +} /* Menu Bar */ .menu-container { diff --git a/index.html b/index.html index 9ddbd6f..92cecad 100644 --- a/index.html +++ b/index.html @@ -31,6 +31,12 @@ + + + +