ANP ANP - 3 months ago 8
CSS Question

Hiding the scrollbar on an HTML page

Can CSS be used to hide the scroll-bar? How would you do this?

jao jao
Answer

Set overflow: hidden; on the body tag like this:

<style type="text/css">
body {
    overflow:hidden;
}
</style>

The code above hides both horizontal and vertical scrollbar.

If you want to hide only the vertical scrollbar, use overflow-y:

<style type="text/css">
body {
    overflow-y:hidden;
}
</style>

And if you want to hide only the horizontal scrollbar, use overflow-x:

<style type="text/css">
body {
    overflow-x:hidden;
}
</style>

update: I meant hidden, sorry, just woke up :-)

Comments