.back{ position: fixed; top: 20px; right: 30px; display: none; z-index: 99; font-size: 20px; border: none; outline: none; background-color: #04AA6D ; color: white; cursor: pointer; border-radius: 20px; height: 40px; width: 40px; font-weight: bolder; text-align: center; line-height: 40px; } #topBtn { display: none; position: fixed; bottom: 20px; right: 30px; z-index: 99; font-size: 20px; border: none; outline: none; background-color: #04AA6D ; color: white; cursor: pointer; border-radius: 20px; height: 40px; width: 40px; font-weight: bolder; } #topBtn:hover, .back:hover { background-color: #555; }