Source: Hide scroll bar, but while still being able to scroll sur Stack Overflow
Sous Chrome:
…mais ne fonctionne pas sous Firefox ou Internet Explorer.
1 2 3 |
::-webkit-scrollbar { display: none; } |
Solutions universelles
Voir aussi plus bas dans le cas d’une iFrame. Voir le billet original sur Stack Overflow pour des liens vers des jsFiddle d’example.
1 2 3 4 5 6 7 8 9 10 11 12 |
#parent{ height: 100%; width: 100%; overflow: hidden; } #child{ width: 100%; height: 100%; overflow-y: scroll; padding-right: 17px; /* Increase/decrease this value for cross-browser compatibility */ } |
ou avec position: absolute;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#parent{ height: 100%; width: 100%; overflow: hidden; position: relative; } #child{ position: absolute; top: 0; bottom: 0; left: 0; right: -17px; /* Increase/Decrease this value for cross-browser compatibility */ overflow-y: scroll; } |
Cas d’une iFrame
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
body.pageLabel--liste-de-naissance { .no-space { height: 100%; width: 100%; overflow: hidden; } iframe.js-rbschange-iframe { width: 100% !important; overflow-y: scroll; @media (min-width: @screen-md-min) { padding-right: 17px; /* Increase/decrease this value for cross-browser compatibility */ } } } #tplOneColumn { // un <div> englobant DANS l'iFrame overflow: hidden; } |