How to style the scroll bar and keep the arrows (up and down)?

Asked

Viewed 39 times

2

When I stylize the scrollbar, little arrows go up and down. You can keep them?

<!DOCTYPE html>
<html lang="pt-BR">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Scroll</title>
  <style>
    /*========== ESTILIZAÇÃO DA BARRA DE SCROLL==========*/
    
    body::-webkit-scrollbar {
      width: 15px;
    }
    
    body::-webkit-scrollbar-track {
      background: #e9e9e9;
    }
    
    body::-webkit-scrollbar-thumb {
      background-color: rgb(0, 87, 0);
      border-radius: 100px;
      border: 2px solid #e9e9e9;
    }
    
    body::-webkit-scrollbar-thumb:hover {
      background-color: rgb(3, 49, 3);
    }
  </style>
</head>

<body>
  <div style="width: 100%; height: 2000px">
  </div>
</body>

</html>

The goal is to leave the default arrows after styling on the bar, as in the image below.

inserir a descrição da imagem aqui

  • 1

    I think you will need to do them (with css) on your own, here are some examples: https://stackoverflow.com/q/47576815/8839059

  • There’s no way, because the moment you change the scroll bar, user agent (browser) abandons the arrows.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.