CSS:Example:HideScrollbar
lastmod 2021-07-13created 2021-07-134 edits
How to remove the scrollbar.
Code
html {
overflow: hidden !important;
scrollbar-width: none;
-ms-overflow-style: none;
}
html::-webkit-scrollbar {
width: 0;
height: 0;
}
With Vue
Hide scrollbar in a specific views
I could hide scrollbar in a home.vue using DOM style.
<script>
mounted: function() {
let elHtml = document.getElementsByTagName('html')[0]
elHtml.style.overflowY = 'hidden'
},
destroyed: function() {
let elHtml = document.getElementsByTagName('html')[0]
elHtml.style.overflowY = null
}
</script>