Reputation: 1000
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.
Upvotes: 6
Views: 5835
Reputation: 262919
You can use the CSS overflow property to hide the scrollbars:
html, body {
overflow: hidden;
}
Upvotes: 11
Reputation: 12966
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.
Upvotes: 6
Reputation: 56432
You can try doing overflow:hidden;
in your css file, in the body,html tags.
Upvotes: 1