This depends on whether IE8 displays the page in Quirks standard or mode. For example, the following HTML will display without a scrollbar:
<!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>
But if you remove the doctype declaration, IE8 will display the page in Quirks mode:
<html> <head> <title>test</title> </head> <body> <p>hello</p> </body> </html>
You can also check this by forcing the rendering mode using the developer tools. Press F12 on the page, and at the end of the menu bar (for some reason ...) the "Document Mode" parameter will appear. Switching between standards and Quirks here should also switch the scroll bar.
So ... you need your page to adhere to the HTML standard! It doesn't have to be XHTML Strict, it could be HTML 4 or even XHTML Transitional, if you really should.
W3C Validator can help you with any validation errors.
Graham clark
source share