<button onclick="topFunction()" id="myBtn" title="Go to top">▲</button>
<style>
#myBtn {
position:relative;
top:50%;
left:47.5%;
position: bottom;
display: flex;
align-items: center;
justify-content: center;
z-index: 99;
font-size: 18px;
border: #111;
outline: none;
background-color: #555;
color: #FFFFFF;
cursor: pointer;
padding-top: 10px;
padding-bottom: 10px;
padding-right: 20px;
padding-left: 20px;
border-radius: 40px;
}
#myBtn:hover {
background-color: #111;
</style>
<script>
function topFunction() {
document.documentElement.scrollTop = 0;
}
</script>