Skip to content

Commit

Permalink
feat: added back to top button to main page
Browse files Browse the repository at this point in the history
  • Loading branch information
AlokSinghal328 committed Oct 22, 2023
1 parent a69b915 commit b14e6a3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions CSS/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -710,4 +710,27 @@ footer .copywrite{
.desktop-main-menu .nav-items{
display: none;
}
}

.backtotop {
--offset: 50px;
position:sticky;
bottom: 20px;
margin-left: 45%;
margin-right: 45%;
place-self: end;
margin-top: calc(100vh + var(--offset));

/* visual styling */
text-decoration: none;
font-size: 25px;
padding: 4px 12px 4px 12px;
color: #fff;
background: rgba(0, 0, 0, 0.5);
border-radius: 20px;
white-space: nowrap;
}

.backtotop:hover{
background: rgba(0, 0, 0, );
}
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ <h2>Subscribe to Our Newsletter</h2>
</ul>
<p class="copywrite"><b>ISRO &copy; 2023</b></p>
</footer>

<a href="#" class="backtotop">Back to Top &#8593;</a>
<script src="./JS/copyrightYear.js"></script>
</body>

Expand Down

0 comments on commit b14e6a3

Please sign in to comment.