|
|
|
start date: Thu, 9 Aug 2007 15:41:48 -0400,
posted on: microsoft.public.dotnet.framework.aspnet
back
| Thread Index |
|
1
Homer J. Simpson
|
|
2
C A Upsdell cupsdell\@
|
|
3
Homer J. Simpson
|
IE6 rendering oddity...
I have the following code in an .aspx file. This is pretty close to what's
generated by VS2005 when you create a new .aspx file, other than the <style>
section I added:
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<style>
body {
border-style: none;
margin: 0;
padding: 0;
background-color: #D4D0C8;
overflow: auto;
text-align: center;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
IE6 renders this as shown in the screenshot on the left in the attached
image file...
If I delete the <!DOCTYPE> line, the same file is rendered as shown by the
screenshot on the right.
Why the discrepancy? I just wasted close to two hours trying to get rid of
the border around the client area and scrollbar...
Date:Thu, 9 Aug 2007 15:41:48 -0400
Author:
|
Re: IE6 rendering oddity...
Homer J. Simpson wrote:
> I have the following code in an .aspx file. This is pretty close to what's
> generated by VS2005 when you create a new .aspx file, other than the <style>
> section I added:
>
> <%@ Page Language="C#" %>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
> If I delete the <!DOCTYPE> line, the same file is rendered as shown by the
> screenshot on the right.
>
> Why the discrepancy? I just wasted close to two hours trying to get rid of
> the border around the client area and scrollbar...
The DOCTYPE line makes IE and other browsers conform more closely with
the standards, thereby helping to ensure cross-browser consistency.
Removing the DOCTYPE makes IE and other browsers render pages more like
the browsers of yesteryear, which MAY help compatibility with seriously
outdated legacy sites.
If you are making a new site, use the DOCTYPE. If you are maintaining
something as old as the mountains, it may be wiser to omit it.
Date:Thu, 09 Aug 2007 23:12:57 -0400
Author:
|
Re: IE6 rendering oddity...
> The DOCTYPE line makes IE and other browsers conform more closely with the
> standards, thereby helping to ensure cross-browser consistency.
>
> Removing the DOCTYPE makes IE and other browsers render pages more like
> the browsers of yesteryear, which MAY help compatibility with seriously
> outdated legacy sites.
>
> If you are making a new site, use the DOCTYPE. If you are maintaining
> something as old as the mountains, it may be wiser to omit it.
This page is going to be embedded in a toolbar on my desktop (loaded by
creating a new toolbar, and pointing to http://localhost/whatever.aspx).
Removing the border and scrollbar makes it look completely seamless (which
is what I'm after). So in this particular case, I guess I'm not gonna break
anything by omitting the DOCTYPE line.
I find it curious though that my styles are respected if I omit the line
(switching the browser into 'ancient page mode'), yet they're ignored if the
line is there. Seems to me it should be the opposite. Well, whatever--I
can live with that.
Date:Fri, 10 Aug 2007 09:46:16 -0400
Author:
|
|
|