by Sai gowtham

How to hide the Scroll Bars using CSS

In this tutorial, we are going to learn about how to hide scroll bars (horizontally, vertically) in a webpage using the CSS.

Hiding the scroll bars

To hide the scroll bars both horizontally and vertically, we need to add an overflow: hidden to the parent element.

body{
  overflow: hidden;
}

Hiding the scroll bar Horizontally

To hide the horizontal scroll bar, we can use the overflow-x: hidden property.

body{
  overflow-x: hidden;
}

Hiding the scroll bar Vertically

To hide the vertical scroll bar, we can use the overflow-y: hidden property.

body{
  overflow-y: hidden;
}

Note: By adding an overflow: hidden it also disables the scrolling functionality, so we can’t able to scroll inside the webpage.

If you want to hide the scroll bar but you still be able to scroll inside the webpage, use the following CSS code.

.container{
   width: 200px;
   height: 400px;
   overflow-y: scroll;
}

.container::-webkit-scrollbar {
    display: none;  /* Safari and Chrome browsers */
}

.container {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none;  /* mozilla */
}

Css Tutorials & Demos

How rotate an image continuously in CSS

In this demo, we are going to learn about how to rotate an image continuously using the css animations.

How to create a Instagram login Page

In this demo, i will show you how to create a instagram login page using html and css.

How to create a pulse animation in CSS

In this demo, i will show you how to create a pulse animation using css.

Creating a snowfall animation using css and JavaScript

In this demo, i will show you how to create a snow fall animation using css and JavaScript.

Top Udemy Courses

JavaScript - The Complete Guide 2021 (Beginner + Advanced)
JavaScript - The Complete Guide 2021 (Beginner + Advanced)
64,026 students enrolled
52 hours of video content
View Course
React - The Complete Guide (incl Hooks, React Router, Redux)
React - The Complete Guide (incl Hooks, React Router, Redux)
284,472 students enrolled
40 hours of video content
View Course
Vue - The Complete Guide (w/ Router, Vuex, Composition API)
Vue - The Complete Guide (w/ Router, Vuex, Composition API)
152,857 students enrolled
48.5 hours of video content
View Course