XHTML body scrolling problem

Posted on 2006-06-02
Last Modified: 2013-12-16
In Visual Studio 2005 .NET, when creating a new ASPX page, by default it inserts the following header to the top of the page to declare it as an XHTML page.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

In the BODY element, it used to be possible to add the following style attribute to disable the vertical scroll bar displayed within the web browser:

<body style="overflow: hidden;">

However, with the new XHTML header at the top of the page, Internet Explorer ignores the overflow attribute and displays the scroll bar.  We can use "scroll=no" in the BODY element, but according to Visual Studio 2005 .NET this isn't a recognised attribute.

So basically the page's scroll bar IS visible with the following code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="" >
<body style="overflow: hidden;">

And the page's scroll bar is NOT visible with the following code:

<body style="overflow: hidden;">

So my question is how can I hide the page's vertical scroll bar when using an XHTML compliant page?
Question by:danielgallo
    LVL 30

    Accepted Solution

    That's because your <body> does not overflow... it's your <html> that overflows.

    Try this:
    <html style="overflow: hidden;">

    Author Comment

    Thank you!! I've never used style tags on the HTML element before!  Brilliant!
    LVL 30

    Expert Comment


    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
    Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
    The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…
    The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now