EN
CSS - disable scroll bar
4 points
In this short article, we would like to show how to disable a scrollbar using pure CSS.

Quick solution:
xxxxxxxxxx
1
.my-element {
2
overflow: hidden; /* disables scrollbar */
3
}
Note: go to this article to see the pure JavaScript version.
This section shows how to disable both scrollbars using overflow: hidden;
.
xxxxxxxxxx
1
2
<html>
3
<head>
4
<style>
5
6
.my-element {
7
border: 1px solid red;
8
height: 100px;
9
overflow: hidden; /* <------- required to disable scrollbar */
10
}
11
12
</style>
13
</head>
14
<body>
15
<div class="my-element">
16
Sime text...<br /> Sime text...<br /> Sime text...<br /> Sime text...<br /> Sime text...<br />
17
Sime text...<br /> Sime text...<br /> Sime text...<br /> Sime text...<br /> Sime text...<br />
18
Sime text...<br /> Sime text...<br /> Sime text...<br /> Sime text...<br /> Sime text...<br />
19
Sime text...<br /> Sime text...<br /> Sime text...<br /> Sime text...<br /> Sime text...<br />
20
Sime text...<br /> Sime text...<br /> Sime text...<br /> Sime text...<br /> Sime text...<br />
21
Sime text...<br /> Sime text...<br /> Sime text...<br /> Sime text...<br /> Sime text...<br />
22
</div>
23
</script>
24
</body>
25
</html>