Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
If you do as advised above, then mobile browsers will suffer. They scroll does not take up space, as on desktops, so the text will go beyond the right border.
There is another solution:
/* хром, сафари */
.element::-webkit-scrollbar { width: 0; }
/* ie 10+ */
.element { -ms-overflow-style: none; }
/* фф (свойство больше не работает, других способов тоже нет)*/
.element { overflow: -moz-scrollbars-none; }
100% working Chrome, Safari, IE etc
.elem {
overflow: auto;
-ms-overflow-style: none;
scrollbar-width: none;
}
.elem::-webkit-scrollbar {
width: 0;
height: 0;
}
jsfiddle.net/H8xfD/ Use, but on condition that the width is known. The comment above is 100% correct.
And then hope that the person will guess about the possibility of scrolling? Or draw your own scrollbar?
In the style - overflow:hidden
, and the events of the wheel will have to be processed by yourself.
Other options are detailed here.
What if the right margin is negative, and the parent has overflow:hidden .
There is a good option:
<div class="div1">
<div class="div2">
Тут контент
</div>
</div>
.div1 {
width: 300px;
height: 500px;
overflow: hidden;
}
.div2 {
overflow-y: scroll;
max-height: 100%;
width: 100%;
padding-right: 45px;
background: lightpink;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question