scroll attribute (body)
In Firefox, Google Chrome, Safari and Opera, the scrollbars of the body and the scrollbars of the document window are the same.
If you want to hide the scrollbars of the entire document, a possible solution is to set the scroll attribute of the body to 'no' (Internet Explorer) and the overflow style property of the body to 'hidden' (Firefox, Google Chrome, Safari and Opera).
The 'hidden' value does not cause problem in Internet Explorer since the scrollbars of the body are hidden by default.
The problem is when you want to force scrollbars to be always visible. In that case, the scroll attribute needs to be set to 'yes' and the overflow style property should be 'scroll', but the 'scroll' value causes that the scrollbars of the body become visible in IE. To avoid that, you can use conditional comments, but it is not a nice solution.
Fortunately, there is another possibility that solves the problem. The overflow style property of the html element affects the state of the document's scrollbars in all browser. If you want to hide the scrollbars, set it to 'hidden', if you want to force scrollbars to be always visible, set it to 'scroll'.For further details, please see the examples below.
|Scrollbars are added only when necessary.|
|Scrollbars are not added.|
|Default. Scrollbars are always added.|