?
Solved

XHTML body scrolling problem

Posted on 2006-06-02
3
Medium Priority
?
871 Views
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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<body style="overflow: hidden;">
<p>test</p>
</body>
</html>


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

<html>
<body style="overflow: hidden;">
<p>test</p>
</body>
</html>


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

Accepted Solution

by:
GrandSchtroumpf earned 2000 total points
ID: 16818876
That's because your <body> does not overflow... it's your <html> that overflows.

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

Author Comment

by:danielgallo
ID: 16818909
Thank you!! I've never used style tags on the HTML element before!  Brilliant!
0
 
LVL 30

Expert Comment

by:GrandSchtroumpf
ID: 16819639
<:°)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
Geo-targeting is the practice of distributing content based on a person’s location, as best as you can determine it. Let’s look at some ways you could successfully use this tactic. The following tips and case studies could lead to meaningful results.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

864 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