Remove the vertical scroll in html and bootstrap [duplicated]

0

Hello my static page is almost finished, but I have a problem the scroll vertical I notice it insufficient, but when I remove it, I no longer work the scroll with the mouse , I hope you can help me thanks.

this was the code I set to remove the vertical bar but the scroll does not work anymore with the mouse

This page, by the way, helps me to be more optimized

WEB PAGE

<style type="text/css">
            body{overflow-y:hidden;}
</style>
    
asked by Ivan More Flores 07.06.2017 в 22:55
source

1 answer

3

There is a question similar to this one but the answer that was recorded was not the correct one, what you have to do is through a div in the body, you add a css class where you enable the scroll, and through the property -webkit hide the scroll, something like this: (when executing the snippet, use the mouse wheel on the container)

.content {
     border: 1px dashed gray;
  padding: .5em;
  
  white-space: pre-wrap;
  height: 5em;
  overflow-y: scroll; /* se habilita el scroll vertical */
}

.content::-webkit-scrollbar { 
  /* solo oculta su visualizacion */
  display: none;
}
<div class='content'>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris eu
urna et leo aliquet malesuada ut ac dolor. Fusce non arcu vel ligula
fermentum sodales a quis sapien. Sed imperdiet justo sit amet venenatis
egestas. Integer vitae tempor enim. In dapibus nisl sit amet purus congue
tincidunt. Morbi tincidunt ut eros in rutrum. Sed quam erat, faucibus
vel tempor et, elementum at tortor. Praesent ac libero at arcu eleifend
mollis ut eget sapien. Duis placerat suscipit eros, eu tempor tellus
facilisis a. Vivamus vulputate enim felis, a euismod diam elementum
non. Duis efficitur ac elit non placerat. Integer porta viverra nunc,
sed semper ipsum. Nam laoreet libero lacus.

Sed sit amet tincidunt felis. Sed imperdiet, nunc ut porta elementum,
eros mi egestas nibh, facilisis rutrum sapien dolor quis justo. Quisque
nec magna erat. Phasellus vehicula porttitor nulla et dictum. Sed
tincidunt scelerisque finibus. Maecenas consequat massa aliquam pretium
volutpat. Duis elementum magna vel velit elementum, ut scelerisque
odio faucibus.
</div>
    
answered by 07.06.2017 в 23:08