From e5fec7411f91059b093f4c05c55c9fb5ab29dd0a Mon Sep 17 00:00:00 2001 From: MD FAISAL RAHMAN <2021ugcs077@nitjsr.ac.in> Date: Sat, 15 Oct 2022 22:11:33 +0530 Subject: [PATCH 1/2] added a back to top button --- assets/css/styles.css | 23 ++++++++++++++++++++++- index.html | 23 +++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/assets/css/styles.css b/assets/css/styles.css index ad66663..73e99b5 100644 --- a/assets/css/styles.css +++ b/assets/css/styles.css @@ -1,9 +1,30 @@ /*===== GOOGLE FONTS =====*/ @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap"); - +/*back to top button*/ +#myBtn { + display: none; /* Hidden by default */ + position: fixed; /* Fixed/sticky position */ + bottom: 20px; /* Place the button at the bottom of the page */ + right: 30px; /* Place the button 30px from the right */ + z-index: 99; /* Make sure it does not overlap */ + border: none; /* Remove borders */ + outline: none; /* Remove outline */ + background-color: black; /* Set a background color */ + color: white; /* Text color */ + cursor: pointer; /* Add a mouse pointer on hover */ + padding: 15px; /* Some padding */ + border-radius: 10px; /* Rounded corners */ + font-size: 18px; /* Increase font size */ +} + +#myBtn:hover { + background-color: #555; + font-size: 20px; /* Add a dark-grey background on hover */ +} /*===== VARIABLES CSS =====*/ + :root { --header-height: 3rem; --max-section-width: 64rem; diff --git a/index.html b/index.html index c54509b..0adc1b7 100644 --- a/index.html +++ b/index.html @@ -28,6 +28,8 @@
+ +