Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to hide the scrollbars in IE8?

do you know whether there is a way to not let the scrollbars in IE8 appear? I've got a complete empty .html site and loaded it in IE8 and scrollbars are appearing.

I've been searching the net for a while, but couldn't find any hint. Is it solveable with CSS or do I need Javascript?

Every hint is much appreciated.

like image 950
Faili Avatar asked Nov 05 '10 09:11

Faili


People also ask

Can you hide the scrollbar?

If you want to hide the scrollbar and still enable scrolling, then you need to apply a CSS styling to the specific browser you want to affect. To hide the scrollbar from Chrome, Safari, Edge, and Opera, you can use the pseudo-element selector :-webkit-scrollbar and set the display property to none .

How do I hide the scroll bar in inactivity?

There are many ways to hide the scroll bar when the page is inactive. One such way is using the onscroll, onmousewheel, onclick and onmousemove events, which help us to achieve our goal using basic HTML and JavaScript. Approach: The onscroll event is used to disable the scroll bar.


2 Answers

You can use the CSS overflow property to hide the scrollbars:

html, body {
    overflow: hidden;
}
like image 158
Frédéric Hamidi Avatar answered Sep 20 '22 12:09

Frédéric Hamidi


If your blank HTML page is standards-compliant (to some degree I suppose), IE8 will not display scrollbars. You shouldn't need any CSS. Here's a sample page that won't have scrollbars:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
    <head>
        <title>test</title>
    </head>
    <body>
        <p>hello</p>
    </body>
</html>

If IE8 renders the page in Quirks Mode, it will always have scroll bars. You can check exactly what rendering it's using (and test different renderings) in the Developer Tools window (press F12). The "Browser Mode" and "Document Mode" settings at the end of the menu bar will tell you.

like image 26
Graham Clark Avatar answered Sep 19 '22 12:09

Graham Clark